08 2024
This commit is contained in:
parent
c1c613a4b9
commit
881fc84207
384 changed files with 50679 additions and 990 deletions
|
|
@ -22,53 +22,64 @@ class FileController extends Controller
|
|||
{
|
||||
$path = "";
|
||||
$filename = "";
|
||||
if ($disk === 'customer'){
|
||||
$file = \App\Models\CustomerFile::findOrFail($id);
|
||||
$filename = $file->original_name;
|
||||
$path = $file->getPath();
|
||||
}
|
||||
if ($disk === 'travel_user'){
|
||||
$file = \App\Models\CustomerFewoFile::findOrFail($id);
|
||||
$filename = $file->original_name;
|
||||
$path = $file->getPath();
|
||||
}
|
||||
|
||||
if ($disk === 'booking'){
|
||||
$file = \App\Models\BookingFile::findOrFail($id);
|
||||
$filename = $file->original_name;
|
||||
$path = $file->getPath();
|
||||
}
|
||||
|
||||
if ($disk === 'general'){
|
||||
$file = \App\Models\GeneralFile::findOrFail($id);
|
||||
$filename = $file->original_name;
|
||||
$path = $file->getPath();
|
||||
}
|
||||
|
||||
if ($disk === 'booking_fewo'){
|
||||
$file = \App\Models\TravelUserBookingFile::findOrFail($id);
|
||||
$filename = $file->original_name;
|
||||
$path = $file->getPath();
|
||||
}
|
||||
|
||||
if ($disk === 'lead'){
|
||||
$file = \App\Models\LeadFile::findOrFail($id);
|
||||
$filename = $file->original_name;
|
||||
$path = $file->getPath();
|
||||
}
|
||||
|
||||
|
||||
if ($disk === 'cms_file'){
|
||||
$file = \App\Models\CMSContent::findOrFail($id);
|
||||
$filename = $file->name;
|
||||
$path = $file->getPath();
|
||||
|
||||
switch ($disk){
|
||||
case 'customer':
|
||||
$file = \App\Models\CustomerFile::findOrFail($id);
|
||||
$filename = $file->original_name;
|
||||
$path = $file->getPath();
|
||||
break;
|
||||
case 'travel_user':
|
||||
$file = \App\Models\CustomerFewoFile::findOrFail($id);
|
||||
$filename = $file->original_name;
|
||||
$path = $file->getPath();
|
||||
break;
|
||||
case 'booking':
|
||||
$file = \App\Models\BookingFile::findOrFail($id);
|
||||
$filename = $file->original_name;
|
||||
$path = $file->getPath();
|
||||
break;
|
||||
case 'general':
|
||||
$file = \App\Models\GeneralFile::findOrFail($id);
|
||||
$filename = $file->original_name;
|
||||
$path = $file->getPath();
|
||||
break;
|
||||
case 'booking_fewo':
|
||||
$file = \App\Models\TravelUserBookingFile::findOrFail($id);
|
||||
$filename = $file->original_name;
|
||||
$path = $file->getPath();
|
||||
break;
|
||||
case 'lead':
|
||||
$file = \App\Models\LeadFile::findOrFail($id);
|
||||
$filename = $file->original_name;
|
||||
$path = $file->getPath();
|
||||
break;
|
||||
case 'cms_file':
|
||||
$file = \App\Models\CMSContent::findOrFail($id);
|
||||
$filename = $file->name;
|
||||
$path = $file->getPath();
|
||||
break;
|
||||
case 'booking_document':
|
||||
$file = \App\Models\BookingDocument::findOrFail($id);
|
||||
$filename = $file->name;
|
||||
$path = $file->getPath();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (file_exists($path)) {
|
||||
if($do === "download"){
|
||||
return Response::download($path, $filename);
|
||||
|
||||
switch ($do) {
|
||||
case 'file':
|
||||
return Response::file($path);
|
||||
break;
|
||||
case 'download':
|
||||
return Response::download($path, $filename);
|
||||
break;
|
||||
case 'url':
|
||||
return $path.$filename;
|
||||
break;
|
||||
}
|
||||
return Response::file($path);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue