https://github.com/jedymatt/laravel-sail-env
Configures .env file to match the laravel sail environment variable's requirements.
https://github.com/jedymatt/laravel-sail-env
env larave-sail-env laravel laravel-package laravel-sail php sail
Last synced: 9 months ago
JSON representation
Configures .env file to match the laravel sail environment variable's requirements.
- Host: GitHub
- URL: https://github.com/jedymatt/laravel-sail-env
- Owner: jedymatt
- License: mit
- Created: 2022-07-17T08:26:10.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-03-11T05:29:10.000Z (over 3 years ago)
- Last Synced: 2025-01-31T14:16:07.379Z (over 1 year ago)
- Topics: env, larave-sail-env, laravel, laravel-package, laravel-sail, php, sail
- Language: PHP
- Homepage: https://packagist.org/packages/jedymatt/laravel-sail-env
- Size: 41 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# laravel-sail-env



Configures .env file to match the sail environment variable's requirements.
## Installation
Install as development dependency:
```bash
composer require --dev jedymatt/laravel-sail-env
```
## Usage
To configure .env file:
```bash
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](https://github.com/jedymatt/laravel-env-sail/issues)
## Have suggestions?
Feel free to create discussion in [GitHub Discussions](https://github.com/jedymatt/laravel-sail-env/discussions)