Search by

jedymatt / laravel-sail-env

jedymatt

Configures .env file to match the sail environment variable's requirements.

Package info

github.com/jedymatt/laravel-sail-env

pkg:composer/jedymatt/laravel-sail-env

Statistics

Installs: 2 094

Dependents: 0

Suggesters: 0

Stars: 6

Open Issues: 0

v1.1.9 2026-11-17 23:31 UTC

This package is auto-updated.

Last update: 2026-11-17 23:32:39 UTC


README

Packagist Downloads Packagist Version Packagist PHP Version Support

Configures .env file to match the sail environment variable's requirements.

Installation

Install as development dependency:

composer require --dev jedymatt/laravel-sail-env

Usage

To configure .env file:

php artisan sail:env

Why is this created?

To configure the .env file without having to run php artisan sail:install again just to replace the variables in .env file. It would be tedious specially when you have custom configuration in your compose file because sail:install overwrites it.

How?

[v1.1.5 or newer] It reads the sail services from your compose file using a YAML parser. It reads the first of compose.yaml, compose.yml, docker-compose.yml and docker-compose.yaml that exists, the same order docker compose uses when COMPOSE_FILE isn't set. It doesn't read COMPOSE_FILE or override files such as compose.override.yaml. (Since v1.1.7; earlier versions read docker-compose.yml only, which Sail stopped writing in v1.46.0.) Then, It uses the sail's InteractsWithDockerComposeServices trait to replace env variables so that it keeps in sync to laravel/sail package.

[v1.1.4 or older] It reads the services of sail inside docker-compose.yml file using regex. Then, It uses the sail's InstallCommand's replaceEnvVariables method so that it keeps in sync to laravel/sail package.

Notes

v1.1.5 or newer is only compatible to laravel/sail v1.20.0 and up.

Testing

composer install
composer test

Found Bugs?

Report to GitHub Issues

Have suggestions?

Feel free to create discussion in GitHub Discussions