0

How can I get the laravel 4 debugger page in laravel 5 debugger page

enter image description here

here

to

enter image description here

1

1 Answer 1

1

Install the whoops package:

composer require filp/whoops

Then use it to render your exceptions by editing your app/Exceptions/Handler.php:

<?php namespace App\Exceptions;

use Exception;
use Whoops\Run as Whoops;
use Illuminate\Http\Response;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use PragmaRX\Sdk\Services\ExceptionHandler\Service\Facade as SdkExceptionHandler;

class Handler extends ExceptionHandler {

    protected $dontReport = [
        'Symfony\Component\HttpKernel\Exception\HttpException'
    ];

    public function report(Exception $e)
    {
        return parent::report($e);
    }

    public function render($request, Exception $e)
    {
        if ($this->isHttpException($e))
        {
            return $this->renderHttpException($e);
        }

        if (env('APP_DEBUG'))
        {
            return $this->whoops($e);
        }

        return parent::render($request, $e);
    }

    protected function whoops(Exception $e)
    {
        $handled = with(new Whoops)
                    ->pushHandler(new \Whoops\Handler\PrettyPageHandler())
                    ->handleException($e);

        return new Response(
            $handled,
            $e->getStatusCode(),
            $e->getHeaders()
        );
    }

}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.