dalholm/laravel-settings
最新稳定版本:v0.9
Composer 安装命令:
composer require dalholm/laravel-settings
包简介
Database settings package for Laravel
关键字:
README 文档
README
Simple and powerful settings package for laravel with fallback and cache option.
Installation
You can install the package via composer:
composer require dalholm/laravel-settings
Publish
php artisan vendor:publish --tag=laravel-settings
Config
/* * You can place your custom package configuration in here. */ return [ /* |-------------------------------------------------------------------------- | Cache |-------------------------------------------------------------------------- | Cache is only working with redis and uses cache tags | */ 'cache' => [ 'enabled' => env('SETTINGS_CACHE_ENABLED', false), 'profile' => Dalholm\LaravelSettings\Cache\CacheProfile::class, 'store' => null, ], /* |-------------------------------------------------------------------------- | Database settings |-------------------------------------------------------------------------- | You could use what ever you want | */ 'database' => [ 'connection' => null, 'table' => 'settings', 'key' => 'key', 'value' => 'value', ], /* |-------------------------------------------------------------------------- | Fallback |-------------------------------------------------------------------------- | Use this as a fallback if settings is not yet available in database | | Example: | "power" => "is-on" | */ 'fallback' => [ // ], ];
Usage
// Create / update setting or settings // Settings will automatically update database and replace cache settings(['key' => 'value']); // Create / update multple settings([ 'key 1' => 'value 1', 'key 2' => 'value 2', 'key 3' => 'value 3', // etc ]); // Get settings('key');
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email mikael@dalholm.se instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
Laravel Package Boilerplate
This package was generated using the Laravel Package Boilerplate.
统计信息
- 总下载量: 728
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-09-25