laravel-daddy/swift-settings
最新稳定版本:4.0
Composer 安装命令:
composer require laravel-daddy/swift-settings
包简介
easy way to manage and cache settings in laravel app
README 文档
README
Crafted with ♥️ by Laravel Daddy
Installation
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.
Usage
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.
Using the Facade
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');
Using the Helper Method
// 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.
统计信息
- 总下载量: 7
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-09-21