ahmmed / admin-ancillary
此包将检查管理员用户在admin中控制访问的权限。
v4.0.1
2022-12-26 16:01 UTC
Requires
- php: ^7.3|^8.0
- laracasts/flash: ^3.0
- laravel/framework: ^9.0
README
Ahmmed/AdminAncillary
Laravel Ahmmed/AdminAncillary 检查基于角色的权限,用于构建 Laravel 5 的内置 Auth 系统。AdminAncillary 保护路由甚至 CRUD 控制器方法。
目录
需求
入门
文档
贡献指南
需求
This package requires PHP >=7.0.0
入门
安装
composer require ahmmed/admin-ancillary
Publish the package migrations,asset and views to your application
php artisan vendor:publish --provider="Ahmmed\AdminAncillary\AdminAncillaryServiceProvider"
After successful publish, Add the role relationship method and user_role fillable field to your User model.
public function role(){
return $this->hasOne(Role::class,'id','user_role');
}
and also add below lines into DatabaseSeeder file
$this->call(UserTableSeeder::class);
$this->call(MenuTableSeeder::class);
$this->call(RoleTableSeeder::class);
After that run
"php artisan migrate"
and
"php artisan db:seed"
Add the middleware to your app/Http/Kernel.php.
protected $routeMiddleware = [
'check_permission' => 'Ahmmed\AdminAncillary\CheckPermission',
];
If your application have no error view page then add error view page.
Also add DEFAULT_LOGO and DEFAULT_FAVICON in your .env file for upload logo and favicon in app settings
文档
Follow along the Wiki to find out more.
贡献指南
Support follows PSR-2 PHP coding standards, and semantic versioning.
Please report any issue you find in the issues page. Pull requests are welcome.