• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

appzcoder/laravel-admin: Laravel Admin Panel

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

appzcoder/laravel-admin

开源软件地址(OpenSource Url):

https://github.com/appzcoder/laravel-admin

开源编程语言(OpenSource Language):

PHP 100.0%

开源软件介绍(OpenSource Introduction):

Laravel Admin Panel

An admin panel for managing users, roles, permissions & crud.

Requirements

Laravel >=5.5
PHP >= 7.0

Features

  • User, Role & Permission Manager
  • CRUD Generator
  • Activity Log
  • Page CRUD
  • Settings

Installation

  1. Run

    composer require appzcoder/laravel-admin
    
  2. Install the admin package.

    php artisan laravel-admin:install
    

    Service provider will be discovered automatically.

  3. Make sure your user model's has a HasRoles trait app/Models/User.php.

    class User extends Authenticatable
    {
        use Notifiable, HasRoles;
    
        ...
  4. You can generate CRUD easily through generator tool now.

Note: If you are using Laravel 7+ then scaffold the authentication with bootstrap for a better experience.

Usage

  1. Create some permissions.

  2. Create some roles.

  3. Assign permission(s) to role.

  4. Create user(s) with role.

  5. For checking authenticated user's role see below:

    // Add role middleware in app/Http/Kernel.php
    protected $routeMiddleware = [
        ...
        'role' => \App\Http\Middleware\CheckRole::class,
    ];
    // Check role anywhere
    if (Auth::check() && Auth::user()->hasRole('admin')) {
        // Do admin stuff here
    } else {
        // Do nothing
    }
    
    // Check role in route middleware
    Route::group(['namespace' => 'Admin', 'prefix' => 'admin', 'middleware' => ['auth', 'role:admin']], function () {
       Route::get('/', ['uses' => 'AdminController@index']);
    });
    
    // Check permission in route middleware
    Route::group(['namespace' => 'Admin', 'prefix' => 'admin', 'middleware' => ['auth', 'can:write_user']], function () {
       Route::get('/', ['uses' => 'AdminController@index']);
    });
  6. For checking permissions see below:

    if ($user->can('permission-name')) {
        // Do something
    }

Learn more about ACL from here

For activity log please read spatie/laravel-activitylog docs

Screenshots

users

activity log

generator

settings

Author

Sohel Amin


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap