diff --git a/app/Services/MarhunPhotoService.php b/app/Services/MarhunPhotoService.php index 08340e99..1cdac2a8 100644 --- a/app/Services/MarhunPhotoService.php +++ b/app/Services/MarhunPhotoService.php @@ -6,6 +6,7 @@ use Illuminate\Http\Request; use Illuminate\Support\Facades\Storage; use App\Models\FileMarhun; use App\Models\LelongBid; +use Exception; class MarhunPhotoService { @@ -14,7 +15,12 @@ class MarhunPhotoService { - $file_type = $request->gambarMarhun->extension(); + try{ + $file_type = $request->gambarMarhun->getClientOriginalExtension(); + } catch(Exception $exception){ + $file_type = 'PNG'; + logger($exception); + } $addfile = new FileMarhun(); $addfile->lelongbid_id = $request->lelongbid_id;