Using 1password for Laravel environment variables
Here's how we handle secrets at Flare
Read more [flareapp.io]
Posts tagged with environment
Here's how we handle secrets at Flare
Read more [flareapp.io]
Here's how we handle our production secrets at Flare.
Read more [flareapp.io]
Join 9,500+ smart developers
Every month I share what I learn from running Spatie, building Oh Dear, and maintaining 300+ open source packages. Practical takes on Laravel, PHP, and AI that you can actually use.
"Freek publishes a super resourceful and practical newsletter. A must for anyone in the Laravel space"
No spam. Unsubscribe anytime. You can also follow me on X.
How many times have you onboarded a new dev onto your team, only to have to spend ages debugging with them because your project's .env.example file is wildly outdated?
Here's a package that can help with that!
Read more [github.com]
Here's how Luke Downing goes about testing environment specific things.
Read more [downing.tech]
Matt Allan took a deep dive learning about environment variables.
Laravel, Symfony, and other modern PHP frameworks use environment variables to store security credentials and configuration that changes from one machine to the next. ... Let’s break down what environment variables are, how they work, and how to correctly use them in your code.
Read more [mattallan.me]
Here's an interesting approach to work with env variables proposed by Marijn Huizendveld
Frameworks offer tools to parameterize environments in a variety of ways. But because of this configuration files of projects tend to get messy once projects are taken into production. Specifying purpose of the parameter within the name can help identify unneeded configurations. Making configuration explicit within the application layer can be even more helpful. Doing so eases refactoring and provides potential to improve the overall developer experience.
Read more [marijn.huizendveld.com]
In a Laravel app most sensitive configuration values, like a db password, are being saved in an .env file. This file usually does not get committed in a git repo. In this way you can share the repo with collaborators without having them to know the sensitive values of your production environment.
The keys of the .env are often saved in an .env.example file that is saved in the repo. This helps you and your collaborators get up to speed quickly when installing the app locally. They can immediately see which environment variables are needed to run the app.
Over time however you might add a variable to .env and forgetting to add it to .env.example. It's a mistake that is easily made, and I have made that mistake many times in the past (sorry co-workers).
A couple of days ago Julien Tant released laravel-env-sync. This package makes sure the .env file is in sync with .env.example. After having installed the package you can run this artisan command to perform the sync:
php artisan env:sync
Thanks Julien for that awesome little package.