laravel-admin/base
Composer 安装命令:
composer require laravel-admin/base
包简介
Admin interface with login for Laravel
README 文档
README
Extend your Laravel App with an admin interface out-of-the-box. This packages creates an admin including a login page. The interface is fully compatible with the default bootstrap interface which is included in your Laravel app.
note: This package is in alpha state, use it in production on own risk.
Installation
Add this package directly with composer:
composer require laravel-admin/base
Add the service provider to your app.php config file
LaravelAdmin\Base\BaseServiceProvider::class,
Add the admin middleware in app/Http/Kernel.php file in the $routeMiddleware array.
'auth.admin' => \LaravelAdmin\Base\Middleware\AuthenticateAdminUser::class
Config
The admin package includes a database migration which adds a role field to your users table. So make sure you run the artisan migrate command.
You can publish the config, so you can manage this in config/admin.php.
php artisan vendor:publish --tag=admin-config
Config options
routeGroup
Defining the properties of all admin routes. By default all routes are separated on a specific domain which you can define as ADMIN_URL in your .env file. But is is also possible to use a subdirectory to replace the domain property by a prefix property like 'admin'.
routeMiddleware
Definition of the middleware what will be used after login. By default you can use the middleware above.
roles
Array with the available user roles.
canLogin
Array with the roles who can login in the admin
js
Array of js files which will be added to the admin interface
css
Array of css files which will be added to the admin interface
menu
Your admin menu structure. Fill this array with items that have a name and url attribute. For a second level you can give an item the attribute children to build a subarray with submenu items.
Usage
Scaffold your base admin routes within your routes/web.php file
Admin::routes(function()
{
// Add your routes
});
Within the closure you can add all your routes on a route group type of definition.
Now you can access the admin by entering the url as defined in the config. Like http://admin.mydomain.com or http://mydomain.com/admin
laravel-admin/base 适用场景与选型建议
laravel-admin/base 是一款 基于 Blade 开发的 Composer 扩展包,目前已累计 4.25k 次下载、GitHub Stars 达 3, 最近一次更新时间为 2017 年 01 月 28 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 laravel-admin/base 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 laravel-admin/base 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 4.25k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 16
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-01-28