Laravel 5. Debug mode

Svetoslav Dimitrov picture Svetoslav Dimitrov · Nov 19, 2016 · Viewed 56.3k times · Source

I set debug mode to true in config->app and deployed it on the server:

'debug' => env('APP_DEBUG', true),

I have following code in Controller to check the mode:

...
$debug = config('app.debug');
var_dump($debug);
$product->save();

Result on local machine:

C:\xampp\htdocs\MK\app\Http\Controllers\ProductController.php:45:boolean true

Result on the server:

bool(false) Whoops, looks like something went wrong.

Why isn't debug mode set on server side?

Answer

James picture James · Nov 19, 2016

This line in your config file, 'debug' => env('APP_DEBUG', true), may be the cause of your issue.

It is saying; set debug to the value defined in my .env file, and if there is none then use true.

As such it is looking at APP_DEBUG=false in your .env file, even though you have set the second parameter to true.

Try updating the setting in your .env file to true.