Please Disable Your Browser Adblock Extension for our site and Refresh This Page!

our ads are user friendly, we do not serve popup ads. We serve responsible ads!

Refresh Page
Skip to main content
On . By CodimTh

Use laravel .env variable in Vue.js


Example .env file:



To use laravel .env variable in Vue.js we simply call


In the real world, it will look like so

data() {
   return() { 
     api_key: process.env.MIX_API_URL

We can now use the laravel .env file to host and use any variables we don't want to store in javascript.


Add new comment

Restricted HTML


Page Facebook

Become a patron

If you need some help or you search a Drupal freelancer don't hesitate to contact us.


Contact Us

All the content is FREE but I still need your help


Become a patreon