patryk-sawicki/admin-gentelella

Gentelella

安装: 111

依赖项: 0

建议者: 0

安全: 0

星标: 0

关注者: 1

分支: 0

开放问题: 0

语言:JavaScript

1.4.1 2024-07-01 06:10 UTC

README

创建自: https://github.com/puikinsh/gentelella

官方Genterella预览: https://colorlib.com/polygon/gentelella/index.html

安装

composer require patryk-sawicki/admin-gentelella 
php artisan lite:install 

此包包含:guard:admin,登录页面,迁移 + 种子表:admin,配置:adminauth

在 vendor:publish 检查后,请检查 /config/adminauth.php 配置文件

用于创建具有“超级管理员”角色的管理员的 Artisan 命令

php artisan lite:admin

控制器中间件

function __construct()
{
    $this->middleware('auth:admin', ['except' => ['logout']]);
    $this->middleware('role:Super Admin');
    // multiple assingment roles per middleware
    $this->middleware('role:Super Admin|Another Role|My Role');
}

// by permission in (for example) RolesController
function __construct()
{
    $this->middleware('auth:admin', ['except' => ['logout']]);

    $this->middleware('permission:role-read');
    $this->middleware('permission:role-create', ['only' => ['create','store']]);
    $this->middleware('permission:role-update', ['only' => ['edit','update']]);
    $this->middleware('permission:role-delete', ['only' => ['destroy']]);
}
```

- - - -

#### Extend admin views or override if you must
Use vendor package src/resources/views/backend for inspiration.
Path "/resources/views/backend/" has a namespace "admin", just create your "backend" folder and use it.
Use this in blade (ex: dashboard.blade.php)

@extends('admin::layouts.gentelella')

@section('content') {{'您的内容在此处'}} @endsection


- - - -