Download the PHP package bdmehedi/laravel-permission without Composer
On this page you can find all versions of the php package bdmehedi/laravel-permission. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bdmehedi/laravel-permission
More information about bdmehedi/laravel-permission
Files in bdmehedi/laravel-permission
Package laravel-permission
Short Description A laravel package to manage laravel roles and permissions
License MIT
Homepage https://github.com/bdmehedi/laravel-permission
Informations about the package laravel-permission
laravel-permission
This is a Laravel package that allows you to manage roles and permissions in any Laravel project with minimal database queries and a small number of loaded models. It is a highly optimized package
Installation, configuration, and uses instructions
install via composer
The service provider will be registered automatically. If you want, you may add it manually.
Publish the migrations and edit as your need
Run the migrations. After publishing the migrations and configuring them as your need you have to create database tables by running the command bellow:
Add the HasPermissions traits to User model(s)
Uses
Create Role and Permission
Assign roles and permissions to User
Withdraw roles and permissions from User
Give permissions to Role
Withdraw permissions from Role
Checking permissions
You can check a user's permission with Laravel's default can function.
Or you can check with hasPermissionTo
Checking roles
Middleware
Default middleware
You can use the laravel default middleware can provided by
Package middleware
If you can check at least one premission of many you can use the middleware
if you have another guard you can user
Contribution Guide
This is still in beta, though I have confidence that it will work as expected. You can contribute by reporting bugs, fixing bugs, reviewing pull requests, and more ways. Go to the issues section, and you can start working on an issue immediately. If you want to add or fix something, open a pull request.