On Laravel 5, on a blade template I want to @yield a part of code only if the environment variable APP_DEBUG is set to true. The code on the blade template is:
@if(env('APP_DEBUG') == 1)
@yield('debugcontrols')
@endif
However no matter if I set APP_DEBUG=false on my .env the line env('APP_DEBUG') will always retrieve 1 while all other environment variables will retrieve its correct value.
How do I get the APP_DEBUG environment variable?
Note that all other environment variables print correctly, for example with,
APP_DEBUG=false
DB_HOST=localhost
The code,
{{ env('DB_HOST') }}
{{ env('APP_DEBUG') }}
{{ Config::get('app.debug') }}
will render,
localhost 1 1

{{ env('APP_DEBUG') }}I get nothing..{{ config('app.name') }}will return APP_NAME from my .env file. Of course when ever you make changes to .env file, be sure to runphp artisan config:cacheto let you application know to clean the config cache. My version of laravel 5.3.30.