diff --git a/README.md b/README.md index 93141e4..5a0b00c 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,19 @@ EnvKit::set('MAIL_HOST', 'smtp.acme.test'); // atomic · backed-up · audited $debug = EnvKit::getBool('APP_DEBUG', false); // typed read ``` -## Quick start +## Quick start guide and usage + +### Getting started + +The service provider and facade register themselves through package discovery, and EnvKit edits +your application's `.env` out of the box. Optionally: + +1. Publish the config to change the defaults (writes `config/laranail/env-kit.php`): + `php artisan vendor:publish --tag=laranail::env-kit-config`. +2. Point it at another file with the `ENV_KIT_PATH` variable. +3. Verify against the current `.env`: `php artisan laranail::env-kit.doctor`. + +### Usage ```php use Simtabi\Laranail\EnvKit\Headless\Facades\EnvKit; @@ -33,6 +45,13 @@ EnvKit::get('MAIL_HOST'); // "smtp.acme.test" EnvKit::getBool('APP_DEBUG', false); // true / 1 / yes / on → true ``` +Target another file per call: + +```php +EnvKit::file(base_path('.env.staging'))->set('APP_ENV', 'staging'); +EnvKit::on('testing')->get('DB_DATABASE'); // → .env.testing alongside the base file +``` + The full walkthrough is in [Programmatic API](docs/tools/programmatic-api.md); everything else is in the [documentation index](#documentation). ## Documentation diff --git a/docs/installation.md b/docs/installation.md index d3ecb68..afac177 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -22,7 +22,7 @@ The package works with sensible defaults out of the box. Publish the config only if you want to change them: ```bash -php artisan vendor:publish --tag=env-kit-config +php artisan vendor:publish --tag=laranail::env-kit-config ``` This writes `config/laranail/env-kit.php`. See [Configuration](configuration.md) for every