Download the PHP package renoki-co/laravel-yaml-config without Composer
On this page you can find all versions of the php package renoki-co/laravel-yaml-config. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download renoki-co/laravel-yaml-config
More information about renoki-co/laravel-yaml-config
Files in renoki-co/laravel-yaml-config
Package laravel-yaml-config
Short Description The usual Laravel config files, but with one YAML. Write objects and arrays in your config without having to write ugly inline, JSON.
License Apache-2.0
Homepage https://github.com/renoki-co/laravel-yaml-config
Informations about the package laravel-yaml-config
Laravel YAML Config
The usual Laravel config files, but with one YAML file. Write objects and arrays in your config without having to write ugly inline, JSON.
🚀 Installation
You can install the package via composer:
Publish the config:
🙌 Usage
This package makes sure you don't have to use inline-JSON in your .env files that would look like this:
First, create a local .laravel.yaml
file in your root Laravel project:
Declare your configuration in YAML:
You shouldn't commit your .laravel.yaml
files to your code repo:
Replacing nested variables
While the package lets you set arbitrary config without messing with ugly encoded JSON, you can still use it to update nested variables with already-existing configuration:
Declaring defaults
While you shouldn't commit your .laravel.yaml
file, you can commit a .laravel.defaults.yaml
file that can contain defaults for specific configs you have declared:
Sequential lists
Take extra caution when declaring defaults for lists of items:
When a config that contains lists that are pre-filled, with a .laravel.yaml
like this, an odd behavior appears:
When you'd expect the final value of clusters
to contain only one item, it will actually contain two items, with the first one being replaced instead:
🐛 Testing
🤝 Contributing
Please see CONTRIBUTING for details.
🔒 Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
🎉 Credits
- Alex Renoki
- All Contributors