Search code examples
phplaravellaravel-6whoopslaravel-6.2

How to Install Whoops in Laravel 6 and Above Versions


I have been Working on the Laravel Framework Since 5.4

Here is the History of Laravel Versions And Error Handlers

  • 4.0 - 4.2 - filp/whoops
  • 5.0 - 5.4 - symfony/error-handler
  • 5.5 - 5.8 - filp/whoops

And By the Relese of Laravel 6.0 they have introduced the new error page Called Ignition

And this package has built in advanced Debugging. But obiviuously this is Done by VueJS.

So At the time Debugging the Api Request in Postman I am not Getting Anything in the Preview.

So is there any Way to Switch to Whoops in the Laravel 6.0 and Future Versions.

Because there is Option to Switch to Ignition even in the Older version of laravel projects

using the Below code in app/Exceptions/Handler.php

protected function whoopsHandler()
{
    try {
        return app(\Whoops\Handler\HandlerInterface::class);
    } catch (\Illuminate\Contracts\Container\BindingResolutionException $e) {
        return parent::whoopsHandler();
    }
}

Solution

  • luckily, since filp/whoops is still in your composer.json (or at least it was in mine) all you have to do is run composer remove facade/ignition and whoops will take over again.

    if not, reinstall filp/whoops with composer require filp/whoops --dev, and remove ignition and that should be it.