brnysn/laravel-settings
最新稳定版本:1.0.1
Composer 安装命令:
composer require brnysn/laravel-settings
包简介
The simplest way to use system settings in Laravel application.
README 文档
README
Installation
You can install the package via composer:
composer require brnysn/laravel-settings
You can publish the config file with:
php artisan vendor:publish --tag="settings-config"
This is the contents of the published config file:
return [ // 'sample' => 'setting', ];
Add middlewares to your app/Http/Kernel.php file $middlewareGroups array in web group:
protected $middlewareGroups = [ 'web' => [ // ... \Brnysn\LaravelSettings\Http\Middleware\SettingsMiddleware::class, ], // ... ];
Usage
Get all settings:
use Brnysn\LaravelSettings\Settings; Settings::all();
Get setting by key:
use Brnysn\LaravelSettings\Settings; Settings::get('key');
Set setting by key:
use Brnysn\LaravelSettings\Settings; Settings::set('key', 'value');
Delete setting by key:
use Brnysn\LaravelSettings\Settings; Settings::delete('key');
Check if setting exists:
use Brnysn\LaravelSettings\Settings; Settings::has('key');
Flush all settings:
use Brnysn\LaravelSettings\Settings; Settings::flush();
Use named api routes to see and change settings:
settings.index settings.update
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 10
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-09-14