javascript - How to get ENV type Laravel + VueJS + Homestead -


i developing app using laravel + vuejs + homestead , knows on laravel 5.2 have env file can set env variables... in way can access javascript code!

i have read proccess.node_env don't know if got right looks works on npm start no? running app through homestead don't know how it!

thanks in advance!

you dump app_env environment variable page hosting javascript , later access or pass vue.

<script type="text/javascript">     var env = "{{ env }}"; </script> 

and in controller...

$env = getenv("app_env"); 

would value of app_env


Comments

Popular posts from this blog

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -