承接 mohit/usertype 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mohit/usertype

Composer 安装命令:

composer require mohit/usertype

包简介

Laravel User types - Admin/User

README 文档

README

This package create user types like Simple user, Admin and Super Admin.

Installation

You can install the package via composer:

composer require mohit/usertype
php artisan vendor:publish --provider="mohit\usertype\UsertypeProvider"
php artisan migrate

Create Admin User

php artisan create:admin

It will ask you to enter name, email and password. Then you can login with entered email and password.

Create Super Admin User

Super Admin user have roles of accessing admin pages as well as user pages.

php artisan create:super

It will ask you to enter name, email and password. Then you can login with entered email and password.

Usage

This package creates and registeres new middleware which you can use in routes file. You can assign middleware to either group of routes or individual routes.

For admin,

Route::group(['middleware' => 'authorize:admin'], function(){
    //
});

For user,

Route::group(['middleware' => 'authorize:user'], function(){
    //
});

For super admin,

Route::group(['middleware' => 'authorize:admin|user'], function(){
    //
});

Using In Blades

@if(auth()->user()->type == 'admin')
  //
@endif

Styling Unauthorized page

When any user try to access page for which he is not authorized then it will redirect him to unauthorized page. This page follow bootstrap structure. You can style this page by creating new css file under 'public/css/unauthorized.css'.

统计信息

  • 总下载量: 7
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2019-01-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固