Add File model with getFileSizeInMB; pass sizeInStorage to show-documents
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
13
app/Models/File.php
Normal file
13
app/Models/File.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class File
|
||||
{
|
||||
public static function getFileSizeInMB(int $bytes): string
|
||||
{
|
||||
if ($bytes <= 0) return '0';
|
||||
$mb = $bytes / 1024 / 1024;
|
||||
return number_format($mb, 2);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user