Upload Files Booking, Mails, Attachments,

This commit is contained in:
Kevin Adametz 2020-04-17 15:51:22 +02:00
parent 5daea268f7
commit 68b9d1ff88
92 changed files with 2837 additions and 1778 deletions

View file

@ -57,66 +57,14 @@ Route::get('/', 'HomeController@index')->name('home');
Route::get('/check/login/{identify}/{token}/{show?}', 'HomeController@checkLogin')->name('check_login');
Route::get('/user/update_email_confirm/{token}', 'UserUpdateEmailController@activateMail')->name('user_update_email_confirm');
Route::get('/storage/file/{id}/{disk}', function($id = null, $disk = null)
{
$file = \App\Models\CustomerFile::findOrFail($id);
$path = Storage::disk($disk)->path($file->dir.$file->filename);
if (file_exists($path)) {
return Response::file($path);
}
})->name('storage_file');
Route::get('/storage/file/{id}/{disk}/{do?}', 'FileController@show')->name('storage_file');
Route::get('customer_file/show/{model}/{id}/{cd?}', 'CustomerFileController@show')->name('customer_file_show');
Route::group(['middleware' => ['auth']], function()
{
Route::get('storage/{type?}/{class?}/{year?}/{file?}/{do?}', function($type = null, $class = null, $year = null, $file = null, $do = null) {
/*if ($type == 'xls') {
$path = storage_path("app/export/");
$filename = $file . '.xls';
}*/
$path = "";
$filename = "";
$headers = [];
if ($class == 'invoices' || $class == 'infos'){
$headers = [
'Content-Type: application/pdf',
'Pragma: no-cache',
'Cache-Control: no-store,no-cache, must-revalidate, post-check=0, pre-check=0'
];
$dir = $year."/";
$filename = $file;
if ($type == 'fewo') {
if(Storage::disk('fewo_invoices')->exists( $dir.$filename )){
$path = Storage::disk('fewo_invoices')->path($dir.$filename);
}
}
if ($type == 'fewo') {
if(Storage::disk('fewo_infos')->exists( $dir.$filename )){
$path = Storage::disk('fewo_infos')->path($dir.$filename);
}
}
}
if (file_exists($path)) {
if($do == "download"){
return Response::download($path, $filename, $headers);
}
if($do == "file"){
return Response::file($path, $headers);
}
}
})->name('storage');
Route::get('storage/{type?}/{class?}/{year?}/{file?}/{do?}', 'FileController@showExpert')->name('storage');
Route::get('/home', 'HomeController@show')->name('home');
/* Route::get('/user/edit', 'UserController@userEdit')->name('user_edit');
*/
Route::group(['middleware' => ['auth.permission:my-dat']], function() {
Route::get('/user/edit', 'UserDataController@userEdit')->name('user_edit');
@ -160,7 +108,6 @@ Route::group(['middleware' => ['admin']], function()
Route::get('/customer_mail/delete/{id}', 'CustomerMailController@delete')->name('customer_mail_delete');
Route::post('customer_mail/ajax', 'CustomerMailController@ajax')->name('customer_mail_ajax');
Route::get('customer_file/show/{model}/{id}/{cd?}', 'CustomerFileController@show')->name('customer_file_show');
Route::group(['middleware' => ['auth.permission:cms-iq-assets']], function() {
//assets
@ -241,7 +188,7 @@ Route::group(['middleware' => ['admin']], function()
Route::get('data/table/customer_mails', 'CustomerMailController@getCustomerMails')->name('data_table_customer_mails');
Route::get('/customer_mails', 'CustomerMailController@index')->name('customer_mails');
Route::get('/customer_mail/detail/{id}', 'CustomerMailController@detail')->name('customer_mail_detail');
Route::post('/customer_mail/detail/{id}', 'CustomerMailController@store')->name('customer_mail_detail');
Route::post('/customer_mail/detail/{id}/{action?}', 'CustomerMailController@store')->name('customer_mail_detail');
Route::get('/customer_mail/delete/{id}', 'CustomerMailController@delete')->name('customer_mail_delete');
});