muetzeofficial / laravel-settings
This package is abandoned and no longer maintained.
No replacement package was suggested.
Global settings loaded from the database
1.0
2019-12-17 10:29 UTC
Requires
- php: >=5.6
- illuminate/database: ^5.4|^6.0
- illuminate/support: ^5.4|^6.0
Requires (Dev)
- orchestra/database: ^3.7
- orchestra/testbench: ~3.7
This package is not auto-updated.
Last update: 2021-06-02 14:46:16 UTC
README
Created for Laravel 6
Install
composer require muetzeofficial/laravel-settings
Publish
php artisan vendor:publish --provider="MuetzeOfficial\Settings\SettingsServiceProvider"
Migrate
php artisan migrate
Usage
With the setting() helper, we can get and set options:
// Get setting
setting('someKey');
// Set setting
setting(['someKey' => 'someValue']);
// Check the option exists
setting_exists('someKey');
If you want to check if an option exists, you can use the facade:
use MuetzeOfficial\Settings\SettingFacade as Setting;
Setting::set(['someKey'=>'someValue']);
Setting::set([
'someKey'=>'someValue',
'anotherKey'=>'anotherValue',
]);
Setting::get('someKey');
Blade
@setting('someKey')
Console
It is also possible to set options within the console:
php artisan setting:set {someKey} {someValue}