Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 603
I'll-Be-Back Avatar asked Aug 01 '26 22:08

I'll-Be-Back


2 Answers

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

like image 190
ABDEL-RHMAN Avatar answered Aug 03 '26 12:08

ABDEL-RHMAN


I'm very late to the game here, but if nothing else worked try clearing all cache and then run:

php artisan optimize:clear

like image 33
James Avatar answered Aug 03 '26 13:08

James



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!