Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I check debug mode on Laravel

Tags:

php

laravel

I want to see errors when I work in the localhost.

App\Exceptions\handler.php

I Tried:

public function render($request, Exception $exception)
{
    if ($this->isHttpException($exception) && env('APP_DEBUG') === false) {
        return response()->view('errors.404', [], 404);
    } else {
        return parent::render($request, $exception);
    }
}

or;

if ($this->isHttpException($exception) && App::environment('APP_DEBUG') === false)

I tried it as above but it does not work.

Thanks.


APP_DEBUG is set to true in .env

like image 938
rgn Avatar asked Dec 13 '16 18:12

rgn


People also ask

How do I enable errors in laravel?

Through your config/app. php , set 'debug' => env('APP_DEBUG', false), to true . Or in a better way, check out your . env file and make sure to set the debug element to true.


2 Answers

To avoid big problems with cache, the right way to check is:

config('app.debug') == false

like image 89
insign Avatar answered Oct 15 '22 19:10

insign


Try to change

env('APP_DEBUG') === false

to

env('APP_DEBUG') == false
like image 34
user8271849 Avatar answered Oct 15 '22 20:10

user8271849