antto1 / laravel-admin-ext-config
Config extension for laravel-admin
v1.4.7.1
2020-09-28 07:38 UTC
Requires
- php: >=7.0.0
- antto1/laravel-admin: ^2.0|^3.0
- laravel/framework: ~5.5|~6.0
Requires (Dev)
- laravel/laravel: ~5.5|~6.0
- phpunit/phpunit: ~6.0
README
Inspired by https://github.com/laravel-backpack/settings.
Screenshot
Installation
$ composer require antto1/laravel-admin-ext-config
$ php artisan migrate
Open app/Providers/AppServiceProvider.php
, and call the Config::load()
method within the boot
method:
<?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(); } } }
Then run:
$ php artisan admin:import config
Open http://your-host/admin/config
Usage
After add config in the panel, use config($key)
to get value you configured.
image
有值将会代替value
值
License
Licensed under The MIT License (MIT).