Skip to content

laravel-enso/roles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

340 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Roles

License Stable Downloads PHP Issues Merge Requests

Description

Roles manages role records and role-to-permission assignment in Laravel Enso.

The package exposes CRUD and table APIs for roles, companion endpoints for reading and writing role permissions, and a sync command used to propagate role configuration between environments.

It is intended for Enso applications that use permission-based route access and need roles managed from the backoffice instead of hard-coded seeds alone.

Installation

Install the package:

composer require laravel-enso/roles

Run the package migrations:

php artisan migrate

Optional publishes:

php artisan vendor:publish --tag=roles-config
php artisan vendor:publish --tag=roles-factory
php artisan vendor:publish --tag=roles-seeder

Features

  • Role CRUD, options, table init, table data, and Excel export endpoints.
  • Permission assignment endpoints for reading, setting, and writing role permissions.
  • Config publishing for role restrictions and group visibility.
  • enso:roles:sync command for syncing local role definitions from config/local/roles.

Usage

Main route groups:

  • system.roles.*
  • system.roles.permissions.*

Permission assignment flow:

  • read current role permissions through permissions.get
  • submit updates through permissions.set
  • persist config files through permissions.write

Environment sync:

php artisan enso:roles:sync

The command only runs when the local config/local/roles directory exists.

API

HTTP routes

  • GET api/system/roles/create
  • POST api/system/roles
  • GET api/system/roles/{role}/edit
  • PATCH api/system/roles/{role}
  • DELETE api/system/roles/{role}
  • GET api/system/roles/initTable
  • GET api/system/roles/tableData
  • GET api/system/roles/exportExcel
  • GET api/system/roles/options
  • GET api/system/roles/permissions/get/{role}
  • POST api/system/roles/permissions/set/{role}
  • POST api/system/roles/permissions/write/{role}

Artisan commands

  • enso:roles:sync

Depends On

Required Enso packages:

Companion frontend package:

Contributions

are welcome. Pull requests are great, but issues are good too.

Thank you to all the people who already contributed to Enso!

About

Laravel Enso Role Manager dependency makes it easy to manage the roles for your users and owners as well as allocate permissions for each role

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages