laravel-exceptions

Laravel 5.7 How to Log 404 With URL

核能气质少年 提交于 2020-05-13 07:49:20
问题 I want to log 404 errors in Laravel 5.7, but I don't understand how to turn this on. Additional to logging 404 errors, I'd like to log the URL that was requested. Other errors are logged correctly. .env APP_DEBUG=true LOG_CHANNEL=stack config/logging.php 'stack' => [ 'driver' => 'stack', 'channels' => ['daily'], ], Per the Error Handling documentation: The $dontReport property of the exception handler contains an array of exception types that will not be logged. For example, exceptions

Laravel 5.7 How to Log 404 With URL

余生颓废 提交于 2020-05-13 07:49:11
问题 I want to log 404 errors in Laravel 5.7, but I don't understand how to turn this on. Additional to logging 404 errors, I'd like to log the URL that was requested. Other errors are logged correctly. .env APP_DEBUG=true LOG_CHANNEL=stack config/logging.php 'stack' => [ 'driver' => 'stack', 'channels' => ['daily'], ], Per the Error Handling documentation: The $dontReport property of the exception handler contains an array of exception types that will not be logged. For example, exceptions

Laravel 5.7 How to Log 404 With URL

别说谁变了你拦得住时间么 提交于 2020-05-13 07:48:51
问题 I want to log 404 errors in Laravel 5.7, but I don't understand how to turn this on. Additional to logging 404 errors, I'd like to log the URL that was requested. Other errors are logged correctly. .env APP_DEBUG=true LOG_CHANNEL=stack config/logging.php 'stack' => [ 'driver' => 'stack', 'channels' => ['daily'], ], Per the Error Handling documentation: The $dontReport property of the exception handler contains an array of exception types that will not be logged. For example, exceptions

laravel: Argument 1 passed to App\Exceptions\CustomException::report() must be an instance of Exception,

允我心安 提交于 2019-12-11 03:47:20
问题 I have created a custom exception class in Laravel 5.2. It works well till laravel 5.4. When Im trying to use the same custom exception class with laravel 5.5 it is throwing following error. Type error: Argument 1 passed to App\Utility\Exceptions\CustomException::report() must be an instance of Exception, none given, called in /var/www/html/bubbles/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php on line 102 {"exception":"[object] (Symfony\\Component\\Debug\\Exception

Laravel error handling, get_class vs instanceof

给你一囗甜甜゛ 提交于 2019-12-11 03:21:39
问题 In the following code in app/Exceptions/Handler.php, the first one doesn't work but the second one does. dd(get_class($exception)); outputs "Illuminate\Database\Eloquent\ModelNotFoundException". The first one is similar to the doc. How can I make it work using instanceof ? public function render($request, Exception $exception) { //dd(get_class($exception)); // this does not work. if ($exception instanceof Illuminate\Database\Eloquent\ModelNotFoundException ) { return response()->json(['error'

Laravel Exception 405 MethodNotAllowed

社会主义新天地 提交于 2019-12-10 19:52:17
问题 I'm trying to create a new "Airborne" test in my program and getting a 405 MethodNotAllowed Exception. Routes Route::post('/testing/{id}/airbornes/create', [ 'uses' => 'AirborneController@create' ]); Controller public function create(Request $request, $id) { $airborne = new Airborne; $newairborne = $airborne->newAirborne($request, $id); return redirect('/testing/' . $id . '/airbornes/' . $newairborne)->with(['id' => $id, 'airborneid' => $newairborne]); } View <form class="sisform" role="form"