Skip to content
Advertisement

Accessing Laravel .env variables in blade

I am trying to get some API keys which I have stored in my .env file to use in the blade javascript. I have added two keys like:

JavaScript

In blade I need to use the Google Maps API and OverheidIO API key. I have tried getting one of the default .env variables just in case I have formatted the custom .env variables wrong.:

JavaScript

Could someone help me call the google maps api and overheidio api key in the blade?

Advertisement

Answer

Five most important commands if your Laravel is not working as expected after some modifications in .env or database folder or because of any other modifications. Here is full explanation: https://www.youtube.com/watch?v=Q1ynDMC8UGg

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement