easy way to manage and cache settings in laravel app
laravel-daddy/swift-settings is a Laravel package for easy way to manage and cache settings in laravel app.
It currently has 0 GitHub stars and 7 downloads on Packagist (latest version 4.0).
Install it with composer require laravel-daddy/swift-settings.
Discover more Laravel packages by laravel-daddy
or browse all Laravel packages to compare alternatives.
Last updated
Crafted with ♥️ by Laravel Daddy
To install the package, run the following command:
composer require laravel-daddy/swift-settings
Upon installation, the package will automatically publish the necessary migrations and register the SwiftSettingsServiceProvider.
All settings are automatically cached to enhance the performance of your application. This ensures that accessing settings is efficient and optimized.
You can manage settings using either the facade or the helper method.
use LaravelDaddy\SwiftSettings\Facade\SwiftSettingsFacade;
// Retrieve a setting by its key, with a default value if the key doesn't exist
SwiftSettingsFacade::getSetting('key', 'default_value');
// Set a new value for a specific key
SwiftSettingsFacade::setSetting('key', 'value');
// Retrieve a setting by its key, with a default value if the key doesn't exist
swift_settings()->getSetting('key', 'default_value');
// Set a new value for a specific key
swift_settings()->setSetting('key', 'value');
Both approaches allow you to retrieve or update settings efficiently, with all keys being cached for improved performance.