dedermus/config

为 open-admin-core 开发的配置扩展,感谢 z-song

2.0.1 2024-09-03 14:31 UTC

This package is not auto-updated.

Last update: 2024-10-01 14:47:35 UTC


README

StyleCI Packagist Total Downloads Pull request welcome

文档

截图

config screenshot

安装

$ composer require dedermus/config

$ php artisan migrate

打开 app/Providers/AppServiceProvider.php 文件,在 boot 方法中调用 Config::load() 方法

<?php

namespace App\Providers;

use OpenAdminCore\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)