Skip to content

Latest commit

 

History

History
45 lines (33 loc) · 1.36 KB

getting-back-whoops-error-pages-in-laravel-9.md

File metadata and controls

45 lines (33 loc) · 1.36 KB
  • Date : 2022-03-13
  • Tags : #php #laravel

Getting back Whoops error pages in Laravel 9

Laravel 9 uses "Spatie/Ignition" as default error handling pages , which is beatiful but bloated within add-on service like Flare.

So if you want to get back the good-old "Whoops" error pages, this tutorial is for you :D

First, we remove "spatie/ignition" from composer packages

$ composer remove "spatie/laravel-ignition"

Then, add 3 lines in the boot function of AppServiceProvider

use Illuminate\Contracts\Foundation\ExceptionRenderer;
use Illuminate\Foundation\Exceptions\Whoops\WhoopsExceptionRenderer;

class AppServiceProvider extends ServiceProvider {
    public function boot()
    {
        // Add 3 lines below between boot function
        if (config('app.debug')) {
            $this->app->bind(ExceptionRenderer::class, WhoopsExceptionRenderer::class);
        }
    }
}

And last but not least, open the config/app.php then add to this line to array config (try to replace the name of Editor you use in this list )

    ...
    'editor' => 'vscode'
    ...

Now try to add this line to second line in web.php route file to test

$x = 1 / 0;