jedymatt / laravel-sail-env

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

Home Page:https://packagist.org/packages/jedymatt/laravel-sail-env

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

laravel-sail-env

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 docker-compose.yml because sail:install command overwrites your docker-compose.yml file.

How?

[v1.1.5 or newer] It reads the services of sail inside docker-compose.yml file using yaml parser. 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.

Found Bugs?

Report to GitHub Issues

Have suggestions?

Feel free to create discussion in GitHub Discussions

About

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

https://packagist.org/packages/jedymatt/laravel-sail-env

License:MIT License


Languages

Language:PHP 100.0%