How do I access the debug variable in app/config/app.php
from my controller to see if I am in debug mode?
<?php
|
/* | if ( $this->user->id )
|-------------------------------------------------------------------------- | {
| Application Debug Mode | // Save roles. Handles updating.
|-------------------------------------------------------------------------- | $this->user->saveRoles(Input::get( 'roles' ));
| |
| When your application is in debug mode, detailed error messages with | // Redirect to the new user page
| stack traces will be shown on every error that occurs within your | return Redirect::to('admin/users/'.$this->user->id)->with('success', Lang::get('admin/users/messages.cre
| application. If disabled, a simple generic error page is shown. |ate.success'));
| | }
*/ | else
| {
'debug' => true,
You can use the helper function config (Laravel 5+).
$debug = config('app.debug');
Laravel 4.2:
$debug = Config::get('app.debug');
This question already has right answer, I just wanted to add that doing it with environmental variables is a better option:
'debug' => env('APP_DEBUG', false),
In .env file:
APP_ENV=local
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With