yeknava / simple-admin
laravel 的简单管理包
0.6
2020-04-21 01:00 UTC
Requires
- php: >= 7.1
- ext-json: *
- illuminate/contracts: 5.5.*|5.6.*|5.7.*|5.8.*|6.*|7.*
- illuminate/database: 5.5.*|5.6.*|5.7.*|5.8.*|6.*|7.*
- illuminate/http: 5.5.*|5.6.*|5.7.*|5.8.*|6.*|7.*
- illuminate/notifications: 5.5.*|5.6.*|5.7.*|5.8.*|6.*|7.*
- illuminate/pagination: 5.5.*|5.6.*|5.7.*|5.8.*|6.*|7.*
- illuminate/routing: 5.5.*|5.6.*|5.7.*|5.8.*|6.*|7.*
- illuminate/support: 5.5.*|5.6.*|5.7.*|5.8.*|6.*|7.*
README
Laravel Simple Admin Package 允许您为应用程序创建一个简单的管理面板。所有内容都在配置文件中定义,并且可以通过在模型类中覆盖方法进行自定义。
安装
使用包管理器 composer 安装简单管理包。
composer require yeknava/simple-admin
使用方法
在终端运行此命令
php artisan vendor:publish
配置
<?php
use Yeknava\SimpleAdmin\SimpleAdminBasicMiddleware;
return [
/*
* route's base path that will be used for package specific routes.
* (use 'php artisan route:list' to find out all paths)
*/
'route_base_path' => '/simple-admin',
/*
* middlewares that admin needs to pass before access to panel.
* if you don't have any login process that admin may to use it to login first,
* SimpleAdminBasicMiddleware will provide basics auth functionality.
*/
'middlewares' => [SimpleAdminBasicMiddleware::class, 'throttle:10,1'],
/*
* if you are using SimpleAdminBasicMiddleware middleware and you set
* use_login_method config to false, you need to provide default
* username and password to login.
*/
'default_username' => env('SA_USERNAME', 'username'),
'default_password' => env('SA_PASSWORD', 'secret'),
/*
* if you need to use login_method option set this true
*/
'use_login_method' => false,
/*
* you may check username and password with database here, return true
* if username and password fields are match with user.
*/
'login_method' => function(string $username, string $password) : bool {
return true;
},
/*
* admin panel pages:
*/
'pages' => [
'users' => [
'path' => '/users',
'title' => 'Users',
'create' => true,
'edit' => true,
'delete' => true,
'view' => null,
/*
* content is model class, if you need customize any fields or
* process you need to use SimpleAdminTrait in your model class
*/
'content' => \App\User::class,
],
]
];
贡献
欢迎提交拉取请求。对于重大更改,请先提交一个问题以讨论您希望进行哪些更改。