Read photoMarhun in CartController
This commit is contained in:
@@ -92,4 +92,23 @@ class MarhunPhotoService
|
||||
header('Content-Disposition: inline; filename="'.basename($filePath).'"');
|
||||
readfile($filePath);
|
||||
}
|
||||
|
||||
public function get($norujukan_sag, $marhun)
|
||||
{
|
||||
$lelongbidmarhun_id = $marhun->lelongbidmarhun_id;
|
||||
|
||||
$photo_type_name = $marhun->photo_type === 1 ? 'overall_photo' : 'by_marhun_photo';
|
||||
|
||||
$directory = "/{$norujukan_sag}/{$photo_type_name}/";
|
||||
$imageExtension = $marhun->file_type;
|
||||
|
||||
$marhunImageFileName = "overall.{$imageExtension}";
|
||||
|
||||
if (!empty($lelongbidmarhun_id)) {
|
||||
$marhunImageFileName = "$lelongbidmarhun_id.$imageExtension";
|
||||
}
|
||||
|
||||
return Storage::disk('marhun')->get("{$directory}${marhunImageFileName}");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user