简体   繁体   中英

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

https://github.com/facade/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();
    }
}

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM