Laravel Tutorial Fetch env Variable Value in Blade or Controller

Author:

Webslesson

Keywords:

laravel,laravel get env variable in blade,laravel access env variable in blade,laravel get env value in blade,laravel access env variable in controller,laravel get env variable in controller,laravel get config variable in blade,how to access config variable in laravel,get env variable laravel controller,get env variable laravel blade,laravel get env data,laravel get env values,laravel get environment variable value,laravel get env variable value

Subtitles:
hello friends in this video tutorial we are going to learn how to get the dot env file variable value in blade or controller file in laravel framework sometime in laravel programming we need to get dot env file variable value in Louisville blade or controller file then at that time this tutorial will help you now let's start discussing this simple topic so this is our Louisville working folder here we have sample controller file and sample dot blade PHP blade file here we can see laravel dot env file in this file or eval application configuration details has been stored in key and value format now we want to get the value of epi env variable is equal to local value in controller or blade file for this we have go to sample controller file and here we have make index method this is route method of this controller under this we have right dollar environment variable is equal to env method and under this we have right env File key app name here we have use env helper for fetch the value of config or env variable value in Louisville it will return the value of E and v fname key value now we want to send to view blade file so here we have write return statement with view method and under this we have write sample view file name and in second argument we have right compact method and under this we have right environment so we can fetch value from this variable in sample view file now we have go to sample dot blade dot PHP file and here we have right app name is equal to Louisville expression and under this we have right dollar environment variable it will print config variable app name variable on webpage now we have checkout put in browser so here we have write base URL slash sample then on web page we can sample view file here we can see app name is equal to Louisville here it has display env file app name key value which has been getting controller and display on blade file now we want to get config variable value directly on view blade file so here we have right app URL is equal to larval expression and between this we have ripe env method and under this we have right env File app URL key now we have saved code and check output in browser friends here first we have refresh webpage and after refresh of page here we can see up URL is equal to localhost this config variable value has been get on blade file using env helper so here we have seen how can we get the config variable or env file key value on Louisville controller file and blade view file using env helper we will be meet with new Louisville tutorial if you have any query or input regarding this video tutorial please comment your query or input in comment box or if you like this video tutorial please share with your friends or even you can also share on social media also thanks for watching this video tutorial

Loading