marcogeorge7/permission-generator 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

marcogeorge7/permission-generator

Composer 安装命令:

composer require marcogeorge7/permission-generator

包简介

Generate json file with all permission that call in controllers and views

README 文档

README

permission-generator scans your project resources/view/ and app/ folder to find @can(...), Gate::allow(...) functions, then it create keys based on first parameter value and insert into json permission file.

Installation

You just have to require the package

$ composer require marcogeorge7/permission-generator

This package register the provider automatically, See laravel package discover.

Usage

First you have to create json files in resource to save permission in it:

app/
  resources/
    role/
      permissions.json

second, publish the configuration file.

php artisan vendor:publish --provider="PermissionGenerator\Framework\GeneratorServiceProvider"

Output

generator:update command will scan your code to identify new permission keys, then it'll update json file on app/resources/role/ folder appending this keys.

{
    "access_index": "can access all",
    "create_user": "can create user",
    "update_user": ""
}

if for any reason artisan can't find generator:update command, you can register the provider manually on your config/app.php file:

return [
    ...
    'providers' => [
        ...
        PermissionGenerator\Framework\GeneratorServiceProvider::class,
        ...
    ]
]

Customization

You can change the default path of views to scan and the output of the json permission file.

Todo

  • auto create value as a description of permission in json object
  • insert permission in database table permission as defult and can replace it with config file

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-02-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固