1if (App::environment('local')) {
2 // The environment is local
3}
4
5if (App::environment(['local', 'staging'])) {
6 // The environment is either local OR staging...
7}
8
9// or using the 'app' helper
10if (app()->environment('local')) {
11 // The environment is local
12}
13
14if (app()->environment(['local', 'staging'])) {
15 // The environment is either local OR staging...
16}
17
18// using config
19if(config('app.env' == 'local')){
20 // The environment is local
21}
22
23if(in_array(config('app.env'), ['local', 'staging'])){
24 // The environment is either local OR staging...
25}
1if (\Illuminate\Support\Facades\App::environment('production')) {
2 // The environment is production
3}
1if (App::environment('local')) {
2 // The environment is local
3}
4
5if (App::environment(['local', 'staging'])) {
6 // The environment is either local OR staging...
7}