Watch 1 Star 1 Fork 0

wesen / laravel-admin-configPHPMIT

Join us
Explore and code with more than 2 million developers,Free private repositories !:)
Sign up
laravel-admin改良版config扩展,支持二维数组 spread retract

Clone or download
wesen authored 优化md
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

A new Config manager for laravel-admin

预览

添加配置项 配置项列表

安装

版本限制:由于需要使用laravel-admin的KeyValue表单项,所以,laravel-admin需要在1.7.0版本以上;

$ composer require iwesen/laravel-admin-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();
        }
    }
}

引入config扩展:

$ php artisan admin:import config

访问 http://your-host/admin/config

使用方法

  1. 添加配置项 当value仅有一对键值对,且key填写0时,默认此配置项的值未字符串;直接调用 config($key)即可; 当value为多个键值对或只有一对键值对但key不是0时,默认此配置项的值为数组;调用config('item.key')即可。

License

Licensed under The MIT License (MIT).

Comments ( 0 )

Sign in for post a comment

PHP
1
https://gitee.com/iwesen/laravel-admin-config.git
git@gitee.com:iwesen/laravel-admin-config.git
iwesen
laravel-admin-config
laravel-admin-config
master

Help Search

191139_cd20d5fd_5186603 191143_ebef6f8d_5186603