Laravel EnsoLaravel Enso
Guide
Back End
Front End
GitHub
Guide
Back End
Front End
GitHub
  • Back End

    • Action Logger
    • Addresses
    • Algolia
    • Algolia Webshop
    • API
    • Audits
    • Avatars
    • Cache Chain
    • Calendar
    • Cargo Partner
    • Categories
    • Charts
    • CI/CD
    • Cli
    • CNP Validator
    • Comments
    • Commercial
    • Companies
    • Core
    • Countries
    • Currencies
    • Data Export
    • Data Import
    • Discounts
    • Documents
    • Dynamic Methods
    • EAV
    • Emag
    • Enums
    • Excel
    • Facebook
    • Files
    • Filters
    • Financials
    • Forms
    • Frisbo
    • Google
    • Helpers
    • Holidays
    • How-to
    • Image Transformer
    • Impersonate
    • Interactions
    • Inventory
    • IO
    • Localisation
    • Lockable Models
    • Logs
    • Measurement Units
    • Meili Search
    • Meili Search Webshop
    • Menus
    • Migrator
    • Monitored Emails
    • Notifications
    • Packaging Units
    • PDF
    • People
    • Permissions
    • Product Eav
    • Product Lots
    • Products
    • Questionnaires
    • Rememberable
    • Roles
    • Sale Channels
    • Searchable
    • Select
    • Sentry
    • Services
    • Smart Bill
    • Sms Advert
    • Stripe
    • Tables
    • Tasks
    • Teams
    • Ticketing
    • Track Who
    • Tutorials
    • Typesense
    • Typesense Webshop
    • Unit Conversion
    • Upgrade
    • UPS
    • User Groups
    • Users
    • Versions
    • Virtual Call Center
    • Vouchers
    • Webshop
    • Webshop Commercial

Roles

LicenseStableDownloadsPHPIssuesMerge 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:

  • laravel-enso/core ↗
  • laravel-enso/enums ↗
  • laravel-enso/forms ↗
  • laravel-enso/helpers ↗
  • laravel-enso/menus ↗
  • laravel-enso/migrator ↗
  • laravel-enso/permissions ↗
  • laravel-enso/rememberable ↗
  • laravel-enso/select ↗
  • laravel-enso/tables ↗
  • laravel-enso/user-groups ↗
  • laravel-enso/users ↗

Companion frontend package:

  • @enso-ui/roles ↗

Contributions

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

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

Edit this page on GitHub
Last Updated: 4/20/2026, 3:08:27 PM
Prev
Rememberable
Next
Sale Channels