imliam / laravel-env-set-command

Set a .env file variable from the command line.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot set value with =

hartman opened this issue · comments

php artisan env:set APP_KEY base64:Sn8jp11YL5W..7=
Could not set the value in your .env file, reverting...

And when you get an existing value from the env file that has an =, the output strips the = out of value before outputting the value to console.

Some escaping would be awesome

Thought maybe I could work around it by using
php artisan env:set APP_KEY=base64:Sn8jp11YL5W..7=

But apparently it looks for the last = sign, not the first = sign, so it counts this an empty value

I'll look to automatically escaping any equals signs in the value for the next version.

In the meantime, you should be able to get that value to save by wrapping it in quotes:

php artisan env:set APP_KEY="base64:Sn8jp11YL5W..7="

No i tried that as well. I get:

php artisan env:set APP_KEY="base64:Sn8jp11YL5W..7="

Not enough arguments (missing: "value").

P.S. it's a nice plugin, good work.

This has now been fixed and works as intended - you can include values with = in them.