I have saved a file with this command
$newFile = [
\'event_id\' => $event->id,
\'path\' => $storePath
];
EventFi
The more Simpler way is to use Storage Facade
if you have already stored / uploaded file
use Illuminate\Support\Facades\Storage;
public function get_size($file_path)
{
return Storage::size($file_path);
}
Or if you are using S3
Bucket then you can modify the above function like below
use Illuminate\Support\Facades\Storage;
public function get_size($file_path)
{
return Storage::disk('s3')->size($file_path);
}
Check Laravel File Storage