Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Idea: Valet environment variables #146

Closed
dustinleblanc opened this issue Sep 15, 2016 · 4 comments
Closed

Idea: Valet environment variables #146

dustinleblanc opened this issue Sep 15, 2016 · 4 comments

Comments

@dustinleblanc
Copy link

I have been using valet for a while and love it! I think it would pretty damn cool for Valet to automatically load any environment variables contained in a .env file into the virtual host declaration within caddy for the site. It could even be an optional command such as valet load:env or something like that. Does anyone else think this is a feature worthy of being worked on? If so, I might take it up and do a PR

@drbyte
Copy link
Contributor

drbyte commented Sep 15, 2016

This could be beneficial.

I currently just edit my .valet/Caddy/foo.dev file directly to add an environment var to the couple sites that need it:

    fastcgi / 127.0.0.1:9000 php {
        index server.php
+       env VARNAME value
    }

... but of course that requires a manual edit, and remembering the syntax, and remembering the right line to put it on.

@djfurman
Copy link

I think it could be cool. For each laravel site, I open up the dotenv and setup:

  • my local mariadb user and password
  • database equal to the directory name
  • set redis for the session and cache drivers
  • set local redis password

Since these are shared across all of my valet sites I think it makes sense.

@MartinPeverelli
Copy link
Contributor

I too, used to edit the Caddyfile, but since Valet migrated to nginx, I lost the ability to do it.
Plus, creating files for the variables outside the codebase itself, was a little bit off for me.
Anyway, I've been using this locally for a while now, and I made a PR out of it.
#473

@mattstauffer
Copy link
Member

Closing; duplicated by #473, which is (potentially) solved by #474.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants