app env laravel code example
Example 1: what is app_env in laravel
Laravel 5 uses .env file to configure your app. .env should not be committed on your repository, like github or bitbucket. On your local environment your .env will look like the following:
APP_ENV=local
For your production server, you might have the following config:
APP_ENV=production
Example 2: laravel get env variable
dd(env('APP_NAME'));
Example 3: laravel APP_ENV config
if (\Illuminate\Support\Facades\App::environment('production')) {
// The environment is production
}
Example 4: laravel use config
use Illuminate\Support\Facades\Config;