Download the PHP package padosoft/laravel-settings without Composer
On this page you can find all versions of the php package padosoft/laravel-settings. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-settings
Laravel Settings
Persistent on database, fast in memory, application-wide settings for Laravel.
Performance are not invalidated because settings are automatic cached when retrived from database. Da completare docs.
Requirements
PHP >= 7.1.3
Laravel 5.8.*|6.*|7.*|8.*|9.*|10.* (For Laravel framework 5.6.* or 5.7.* please use v1.*)
Installation
composer require padosoft/laravel-settings
- Publish the config and migration files by running
php artisan vendor:publish --provider="Padosoft\Laravel\Settings\ServiceProvider"
. - Run
php artisan migrate
Before running the migrations be sure you have in your AppServiceProviders.php
the following lines:
Installation - Laravel < 5.5
- Add
Padosoft\Laravel\Settings\ServiceProvider
to the array of providers inconfig/app.php
. - Add
'SettingsManager' => 'Padosoft\Laravel\Settings\Facade'
to the array of aliases inconfig/app.php
.
Usage
You can either access the setting store via its facade or inject it by type-hinting towards the abstract class anlutro\LaravelSettings\SettingStore
.
Call Setting::store()
explicitly to save changes made.
You could also use the setting()
helper:
Using in other packages
If you want to use settings manager on other packages you must provide migrations to populate settings table. For Example:
Please take care of populate config_override column with config key you want your setting should override
Add new type of settings with cast and Validation in Config/config.php
Events Listening
Every time a model is created,updated or deleted an event will be dispatched. You can listen these events with a simple Listener in Laravel
Contact
Open an issue on GitHub if you have any problems or suggestions.
License
The contents of this repository is released under the MIT license.
All versions of laravel-settings with dependencies
illuminate/contracts Version >=5.8|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0
illuminate/encryption Version >=5.8|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0
illuminate/validation Version >=5.8|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0
illuminate/database Version >=5.8|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0