tonystore/livewire-permission-manager 问题修复 & 功能扩展

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

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

tonystore/livewire-permission-manager

Composer 安装命令:

composer require tonystore/livewire-permission-manager

包简介

Package that provides a graphical interface to manage roles and permissions.

README 文档

README

Latest Stable Version Packagist Downloads License PHP Version Require

Package that provides a graphical interface to manage roles and permissions.

REQUIREMENTS

Version Compatibility Livewire

Livewire Livewire Permission Manager
2.x 0.2.x
3.x 0.3.x

INSTALLATION VIA COMPOSER

Step 1: Composer

Run this command line in console.

composer require tonystore/livewire-permission-manager

Step 2: Publish Assets

Publish Config File

php artisan vendor:publish --provider="Tonystore\LivewirePermission\LivewirePermissionProvider" --tag=config-permission

Publish Views

Publish the views only if any modifications to the interfaces are required.

php artisan vendor:publish --provider="Tonystore\LivewirePermission\LivewirePermissionProvider" --tag=views-permission

Publish Migrations

Publishes migrations, only if a new column is created for the detail of a role or permission.

php artisan vendor:publish --provider="Tonystore\LivewirePermission\LivewirePermissionProvider" --tag=migrations-permission

Publish Lang

Publish the translations in case you wish to modify any of them.

php artisan vendor:publish --provider="Tonystore\LivewirePermission\LivewirePermissionProvider" --tag=langs-permission

Usage

By default, Tailwind is used to create the role and permissions management interface, but you can also choose the Bootstrap theme.

<?php
return [
	/*
	 * Supported Theme: 'tailwind, bootstrap',
	 */
	'theme'  =>  'tailwind',
];

Configure templates

You have 2 alternatives to use with this package, using the blade directives or using the laravel components.

<?php
return [
	'blade-template'  => [
		'type'  =>  'components', //Supported Type: 'components, directives'
		'component'  =>  'AppLayout', //type: components
		'directives'  => [ //type: directives
			'extends'  =>  'layouts.app',
			'section-content'  =>  'content',
		],
	],
];

Includes the component that contains the scripts and styles needed for the graphic interface.

<head>
    ....
       <x-permissions::styles />
    ....
</head>
 <body> 
    ...
    @livewireScripts
    
    <script src="//cdn.jsdelivr.net/npm/sweetalert2@10"></script>
    //INSERT COMPONENT
       <x-permissions::scripts />
  
 </body>

To remove a role, SweetAlert is used, so you must have it in your design, and it must be before the script component. Note that you must import it after the Livewire scripts.

Select a Modal design

You will be able to select among the types of manners that the package will have, at the moment only a list type model is available, which is configured here:

<?php
return [
	'modals'  => [
		'role'  =>  'list'
	],
];

Customized page

Here you define the array of numbers for the paging options.

<?php
   'paginate' => [
        'perPages' => [
            10, 25, 50, 100, 200
        ]
    ]

Change tables name

Here you assign the names of the tables to be able to run the migration. By default it uses the tables listed in the Laravel Permission package.

<?php
return [
	'tables'  => [
		'roles'  =>  config('permission.table_names.roles', 'roles'),
		'permissions'  =>  config('permission.table_names.permissions', 'permissions'),
	],
];

Exclude roles

Here you define the roles you want to exclude from Livewire queries for display and modification. By default you will have an empty array.

<?php
return [
	'roles'  => [
		'excludes'  => []
	]
];

Column name

Here you define the name of the new column that will be created in the roles and permissions table defined, with this you can add a description to each role or permission created, by default the name of the column is description. By default the name.

<?php
return [
	'column_name'  => [
		'add_column' => false,
		'description'  =>  null,
	],
];

If you mark as true the option to add the description column, you must have previously generated that column in the respective database table.

Route

Set your own prefix and midlewares and name for the role management path and permissions. By default you will have the following:

<?php
return [
	'route'  => [
		'middleware'  => [
			'web',
			'auth'
		],
		'prefix'  =>  'admin',
		'name'  =>  'permission.index',
		'url'  =>  '/roles/manager'
	],
];

Now, once everything is configured, you will be able to access the path to manage your roles.

http://localhost/admin/roles/manager

统计信息

  • 总下载量: 1.05k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 18
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 17
  • Watchers: 2
  • Forks: 3
  • 开发语言: Blade

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-10-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固