Laravel 5 get APP_DEBUG environment variable -
on laravel 5, on blade template want @yield part of code if environment variable app_debug set true. code on blade template is:
@if(env('app_debug') == 1) @yield('debugcontrols') @endif however no matter if set app_debug=false on .env line env('app_debug') retrieve 1 while other environment variables retrieve correct value.
how app_debug environment variable?
note other environment variables print correctly, 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
ok, solved it, can't believe simple... function env() not gets values .env file when called. apparently .env variables stored somewhere needed close , start again server php artisan serve.
Comments
Post a Comment