|
|
|
@ -11,20 +11,6 @@ Route::group(['middleware' => ['web', 'role:admin'], 'prefix' => 'reports'], fun |
|
|
|
Route::get('current-credits', ['as' => 'reports.current-credits', 'uses' => 'ReportsController@currentCredits']); |
|
|
|
|
|
|
|
Route::get('log-files', ['as' => 'log-files.index', 'uses' => 'Reports\LogFileController@index']); |
|
|
|
|
|
|
|
Route::get('log-files/{filename}', ['as' => 'log-files.show', 'uses' => function ($fileName) { |
|
|
|
if (file_exists(storage_path('logs/'.$fileName))) { |
|
|
|
return response()->file(storage_path('logs/'.$fileName), ['content-type' => 'text/plain']); |
|
|
|
} |
|
|
|
|
|
|
|
return 'Invalid file name.'; |
|
|
|
}]); |
|
|
|
|
|
|
|
Route::get('log-files/{filename}/download', ['as' => 'log-files.download', 'uses' => function ($fileName) { |
|
|
|
if (file_exists(storage_path('logs/'.$fileName))) { |
|
|
|
return response()->download(storage_path('logs/'.$fileName), env('APP_ENV').'.'.$fileName); |
|
|
|
} |
|
|
|
|
|
|
|
return 'Invalid file name.'; |
|
|
|
}]); |
|
|
|
Route::get('log-files/{filename}', ['as' => 'log-files.show', 'uses' => 'Reports\LogFileController@show']); |
|
|
|
Route::get('log-files/{filename}/download', ['as' => 'log-files.download', 'uses' => 'Reports\LogFileController@download']); |
|
|
|
}); |