雪软 / config
laravel-admin的配置扩展
v1.1.21
2022-06-09 12:08 UTC
Requires
- php: >=7.0.0
- laravel/framework: >=5.5
- snowsoft/laravel-admin: >=1.6
Requires (Dev)
- laravel/laravel: ~5.5
- phpunit/phpunit: ~6.0
This package is auto-updated.
Last update: 2024-09-09 16:56:33 UTC
README
灵感来源于https://github.com/laravel-backpack/settings.
截图
安装
$ composer require snowsoft/config
$ php artisan migrate
打开app/Providers/AppServiceProvider.php
,在boot
方法中调用Config::load()
方法
<?php namespace App\Providers; use Encore\Admin\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).