Disable laravel error handler

前端 未结 7 800
野的像风
野的像风 2020-12-01 04:40

Is there anyway to disable the laravel error handler all together?

I want to simply display standard PHP errors, not the Who

相关标签:
7条回答
  • 2020-12-01 05:24

    This will get you close. There might be a more proper way of doing this. It replaces Laravel's current exception handler with a single-method class. I haven't tested this, besides the basic route below, so you may need to add other methods to satisfy different situations.

    class ExceptionHandler
    {
        public function handleException($e)
        {
            echo $e;
            die;
        }
    }
    
    App::bind('exception', App::share(function($app)
    {
        return new ExceptionHandler;
    }));
    
    
    Route::get('/', function()
    {
        throw new Exception('Testing');
    });
    
    0 讨论(0)
提交回复
热议问题