Discussion

Permission Module

how can we add custom module in permission

Purvesh
Purvesh
10 months ago

You can use Permission Facade to add a custom permission.


Only the limitation that it has now is ... all the route needs to be a named route as laravel you can do it.


$group = PermissionFacade::add(
	            'custom-unique-permission-group-code',
	            function (PermissionGroup $group) {
	                $group->label('Label');
	            }
	        );
	        $group->addPermission(
	            'admin-permission-unique-code',
	            function (Permission $permission) {
	                $permission->label('Permission Label')
	                    ->routes('route named');
	            }
	        );
Want to contribute?

© AvoRed 2020 Privacy