Wednesday, 15 January 2014

Laravel 4: how can I get the environment value? -



Laravel 4: how can I get the environment value? -

i know can access environment value using global $env variable, there the right way value?

you're in luck - this added in beta 4 - see here details

added app::environment method.

edit: these number of various ways environment variable of laravel 4.1

app::environment() app()->environment() app()->env $globals['env'] // not recommended - possible

you can check if current environment set 'local'

app::islocal() app()->islocal()

you can check if current environment set 'testing'

app::runningunittests() app()->runningunittests()

laravel laravel-4

No comments:

Post a Comment