Rechnungen + Gutschriften

This commit is contained in:
Kevin Adametz 2021-03-31 17:58:25 +02:00
parent 39ef16686a
commit 35ae3da244
33 changed files with 2834 additions and 34 deletions

View file

@ -61,6 +61,34 @@ class FileController extends Controller
}
if ($disk === 'credit'){
$UserCredit = \App\Models\UserCredit::findOrFail($id);
$filename = Invoice::getCreditFilename($UserCredit);
$path = Invoice::getCreditDownloadPath($UserCredit);
if (!Storage::disk('public')->exists($path)) {
return Response::make('File no found.', 404);
}
$file = Storage::disk('public')->get($path);
$type = Storage::disk('public')->mimeType($path);
if($do === 'download'){
return Response::make($file, 200)
->header("Content-Type", $type)
->header('Content-disposition', 'attachment; filename="'.$filename.'"');
/* $full_path = Invoice::getDownloadPath($shopping_order, true);
$he
if (file_exists($full_path)) {
return Response::download($full_path, $filename);
}*/
}
if($do === 'stream'){
return Response::make($file, 200)
->header("Content-Type", $type)
->header('Content-disposition','filename="'.$filename.'"');
}
}
}
}