adspace


Explain, how to get current environment in laravel 5?

Answer Posted / Tasleem Khan

To get the current environment in Laravel 5, you can use the app() global helper function and call the environment method of the Config facade. Here's an example:nn$env = app()->environment();nnThis will return the current environment (like 'local', 'testing', 'staging', or 'production'). You can then compare it with specific environments as needed.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How much laravel experience do you have?

815


Do you know what version of laravel do you generally use?

839


What is latest version of laravel?

869


Tell us have you used lumen before?

809


What is current stable version of laravel?

870