承接 tuvaergun/permission 相关项目开发

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

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

tuvaergun/permission

Composer 安装命令:

composer require tuvaergun/permission

包简介

Light-weight role-based permissions for Laravel 5 built in Auth system.

README 文档

README

Laravel Permission adds role based permissions to built in Auth System of Laravel 5. Permission middleware protects routes and even crud controller methods.

Table of Contents

Requirements

  • This package requires PHP 5.4+

Getting Started

  1. Require the package in your composer.json and update your dependency with composer update:
"require": {
...
"tuvaergun/permission": "~1.0@dev",
...
},
  1. Add the package to your application service providers in config/app.php.
'providers' => [

'Illuminate\Foundation\Providers\ArtisanServiceProvider',
'Illuminate\Auth\AuthServiceProvider',
...
'Tuva\Permission\PermissionServiceProvider',

],
  1. Publish the package migrations to your application and run these with `php artisan migrate.
$ php artisan vendor:publish --provider="Tuva\Permission\PermissionServiceProvider"

Use your own models. Once you publish, it publishes the configuration file where you can define your own models which should extend to Permission models.

  1. Add the middleware to your app/Http/Kernel.php.
protected $routeMiddleware = [

....
'permission' => 'Tuva\Permission\Middleware\HasPermission',

];
  1. Add the HasRole trait to your User model.
use Tuva\Permission\Traits\HasRole;

class User extends Model implements AuthenticatableContract, CanResetPasswordContract
{
use Authenticatable, CanResetPassword, HasRole;
}

Documentation

Follow along the Wiki to find out more.

Roadmap

Here's the TODO list for the next release (2.0).

  • Refactoring the source code.
  • Correct all issues.
  • Adding cache to final user permissions.
  • Adding tests.

Change Logs

June 14, 2015 (latest)

March 28, 2015

  • Added Role Scope to get all users having a specific role. e.g User::role('admin')->get(); will list all users having admin role.

March 7, 2015

  • is() and can() methods now support comma for AND and pipe as OR operator. Or pass an operator as a second param. more information
  • You can bind multiple permissions together so they inherit ones permission. more information

Contribution Guidelines

Support follows PSR-2 PHP coding standards, and semantic versioning.

Please report any issue you find in the issues page. Pull requests are welcome.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-10-05