I'll-Be-Back I'll-Be-Back - 1 month ago 6
PHP Question

APP_DEBUG=true is being ignored

I have

APP_DEBUG=true
in the
.env
file:

APP_ENV=local
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://test.dev


I've deliberately use incorrect incorrect url (eg:
test.dev/asdsadsa
) which does not in the web.php route file.

I expected to get an laravel debug error when route does not exist

Sorry, the page you are looking for could not be found.
NotFoundHttpException in RouteCollection.php line 161:


However, it keep showing 404 error page (views/errors/404.blade.php) even
APP_DEBUG
is set to true.

What I have tried:

1 - I even tested to make sure laravel can read .env file:

Route::get('/', function() {
dd(env('APP_DEBUG'));
});


return
true


2 -
php artisan config:cache
did not fix it.

3 -
chmod -R 777 storage
did not fix it.

Answer

if you have 404 error page in views/errors it will be displayed, and if you haven't, NotFoundHttpException will be displayed.