https://github.com/jedymatt/laravel-roles
Demonstration of different ways to create roles
https://github.com/jedymatt/laravel-roles
laravel roles
Last synced: 4 months ago
JSON representation
Demonstration of different ways to create roles
- Host: GitHub
- URL: https://github.com/jedymatt/laravel-roles
- Owner: jedymatt
- Created: 2023-02-01T06:49:08.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-02-01T07:00:16.000Z (over 2 years ago)
- Last Synced: 2024-12-29T06:09:54.218Z (5 months ago)
- Topics: laravel, roles
- Language: PHP
- Homepage:
- Size: 90.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Laravel Role
Demonstration on how to create your own roles
## One to one
Good for single role user
## Many to Many
Good for multiple role user
### Polymorphic Many to Many
Good for multiple role user, and multiple users with different tables and guard (you can change or add middleware for different guards)
## Setup project
```sh
cp .env.example .env
``````sh
composer install
``````sh
php artisan migrate:fresh --seed
``````sh
php artisan serve
```## Files Changed
- routes/web.php
- database/migrations
- database/seeders
- database/factories
- app/Models
- app/Traits --> this is for polymorphic many to many
- app/Http/Kernel.php
- app/Http/Middleware/AuthorizeRole.php