How to install "Nice whoops-style error processor" in Laravel5, and tell you how to use it in Laravel5
1, first, composer require file/whoops:~1.0.
2. Then open app/exception/handler.php and add a whoops-style handle to the render () method as follows:
/** * Render An exception to an HTTP response. * *@param \illuminate\http\request $request *@param \exception $e *@return \illuminate\http\response * *PublicfunctionRender($request, Exception $e) {if ($this->ishttpexception ($e)) {return $this->renderhttpexception ($e); }if (config (' App.debug ')) {return $this->renderexceptionwithwhoops ($e);} return Parent::render ($request, $e);} /** * Render an exception using whoops. * * @param \exception $e * @return \illuminate\http\response */ PR otected function renderexceptionwithwhoops(Exception $e) {$whoops = new \whoops\run; $whoops Pushhandler (new \whoops\handler\prettypagehandler ()); return new \illuminate\http\response ($whoops->handleexception ($e), $e->getstatuscode (), $e- Getheaders ()); }
3, it is so simple
Address of the original: https://mattstauffer.co/blog/bringing-whoops-back-to-laravel-5
Laravel5 Installing whoops Error Manager