liuhelong / laravel-admin-config
laravel-admin 的配置扩展
1.1
2022-02-18 08:19 UTC
Requires
- php: >=7.0.0
- encore/laravel-admin: >=1.6
- laravel/framework: >=5.5
Requires (Dev)
- laravel/laravel: ~5.5
- phpunit/phpunit: ~6.0
This package is auto-updated.
Last update: 2024-09-18 13:40:12 UTC
README
由 https://github.com/laravel-admin-extensions/config 提供
截图
安装
$ composer require liuhelong/laravel-admin-config
$ php artisan migrate
打开 app/Providers/AppServiceProvider.php
,并在 boot
方法中调用 Config::load()
方法
<?php namespace App\Providers; use Liuhelong\Config\Config; use Illuminate\Support\Facades\Schema; use Illuminate\Support\ServiceProvider; class AppServiceProvider extends ServiceProvider { public function boot() { $table = config('admin.extensions.config.table', 'admin_config'); if (Schema::hasTable($table)) { Config::load(); } } }
然后执行
$ php artisan admin:import config
打开 http://your-host/admin/config
用法
在面板中添加配置后,使用 config($key)
获取您配置的值。
许可证
遵循 MIT 许可证 (MIT)。