close #3098 Fixed: Error saving Bill with attachment
This commit is contained in:
parent
a217e44d6d
commit
268984d040
|
|
@ -17,4 +17,16 @@ class Media extends BaseMedia
|
|||
protected $casts = [
|
||||
'deleted_at' => 'datetime',
|
||||
];
|
||||
|
||||
/**
|
||||
* Calculate the file size in human readable byte notation.
|
||||
* @param int $precision (_optional_) Number of decimal places to include.
|
||||
* @return string
|
||||
*/
|
||||
public function readableSize(int $precision = 1): string
|
||||
{
|
||||
$size = intval($this->size);
|
||||
|
||||
return File::readableSize($size, $precision);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
</span>
|
||||
|
||||
<span class="text-xs mb-0">
|
||||
{{ $file->readableSize() }}
|
||||
{{ is_int($file->size ) ? '0 B' : $file->readableSize() }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@
|
|||
</x-table.td>
|
||||
|
||||
<x-table.td class="w-1/6">
|
||||
{{ $attachment->readableSize() }}
|
||||
{{ is_int($attachment->size ) ? '0 B' : $attachment->readableSize() }}
|
||||
</x-table.td>
|
||||
</x-table.tr>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@
|
|||
</x-table.td>
|
||||
|
||||
<x-table.td class="w-1/6">
|
||||
{{ $attachment->readableSize() }}
|
||||
{{ is_int($attachment->size ) ? '0 B' : $attachment->readableSize() }}
|
||||
</x-table.td>
|
||||
</x-table.tr>
|
||||
@endforeach
|
||||
|
|
|
|||
Loading…
Reference in New Issue