Add Environment Variables In Laravel Homestead

profile picture

Add Environment Variables In Laravel Homestead

As it may seem an easy thing to do, and to be honnest : it is, creating environment variables in your Homestead Virtual Machine is something you cannot find in the documentation.

While it is missing from the official Laravel Documentation, you can still find the info on a lost google page..

So today I'm saving you some trouble.

In order to add new environment variable in Laravel Homestead, simply add these lines in your Homestead.yaml file:

    variables:
        - key: APP_ENV
          value: dev
        - key: SOME_KEY
          value: someValue
        - key: FOO
          value: bar

Of course, don't forget to run vagrant reload --provision in order for your VM to be updated.

about me

profile picture

I consider myself as an IT Business Artisan. Or Consultant CTO. I'm a self-taught Web Developper, coach and teacher. My main work is helping and guiding digital startups.

more about me

follow me

newsletter

A weekly email with the latests articles

support my work

Start trading on binance
  • BTC

    BTC

    bc1qgw9a8hyqqwvcls9ln7vhql4mad0qkveutr2td7

  • ETH

    ETH

    0x3A720717Da03dB6f3c4a4Ff08BC64100205A79d0

recent posts

DDOS By Web Crawlers

1
1 year ago

Something Given

1
1 year ago

2025 © My Dynamic Production SRL All rights Reserved.