Package Data | |
---|---|
Maintainer Username: | xujianhua |
Maintainer Contact: | xujianhua@outlook.com (Jani Xu) |
Package Create Date: | 2016-08-17 |
Package Last Update: | 2017-10-26 |
Home Page: | |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-26 15:03:02 |
Package Statistics | |
---|---|
Total Downloads: | 42 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 0 |
Total Watchers: | 1 |
Total Forks: | 0 |
Total Open Issues: | 0 |
基于laravel5.1.*以上版本的系统数据库读写配置文件。
composer require jani/laravel-db-config
ServiceProvider
:Jani\DbConfig\DbConfigServiceProvider::class,
php artisan vendor:publish
请修改应用根目录下的 config/db_config.php
中对应的项即可;
(可选)添加外观到 config/app.php
中的 aliases
部分:
'DbConfig' =>Jani\DbConfig\Facades\DbConfigFacades::class,
5.使用
/*
*可以是个string字符串或array字符串群发
*/
\DbConfig::set('key','value');
\DbConfig::get('key','default_value');
\DbConfig::delete('key');
无