denis-kisel / lara-dbconfig
: 在数据库中存储额外配置
dev-master
2019-12-11 10:48 UTC
Requires
- illuminate/support: >=5.4
This package is auto-updated.
Last update: 2024-09-11 21:43:10 UTC
README
将额外配置存储在数据库中。使用序列化
。
演示/用法
use DenisKisel\DBConfig\DBConfig; ... //PUT DBConfig::put($key, $value); # Value is anyway type(string|array|object|etc..) //GET DBConfig::get($key) # null if not exists; DBConfig::get($key, $default) # $default if not exists; //Has DBConfig::has($key) # (true|false); //Forget DBConfig::forget($key) # remove by key; //Icrement/Decrement DBConfig::increment($key) # Increment +1 DBConfig::increment($key, $amount) # Increment +$amount DBConfig::decrement($key) # Descrement -1 DBConfig::decrement($key, $amount) # Descrement -$amount
安装
通过Composer
$ composer require denis-kisel/lara-dbconfig
公共配置,如果您需要更改表名。
$ php artisan vendor:publish --provider="DenisKisel\DBConfig\DBConfigServiceProvider"
安装数据库表。默认是settings
表。
$ php artisan dbconfig:install
就这么多。享受使用吧!
额外命令
//Show all configs $ php artisan dbconfig:show //Show config by key $ php artisan dbconfig:show --key=conf_key
许可证
本软件包是开源软件,使用MIT许可证授权。
联系方式
开发者:Denis Kisel
- 电子邮件:denis.kisel92@gmail.com
- Skype:live:denis.kisel92