- What is laravel-enso/roles used for?
- It is the role management module for Laravel Enso applications. It lets you create and edit roles, attach permissions to each role, and assign roles to users and owners. It integrates with Enso's authorization, menus, and user management so access control is consistent across the admin application.
- Can I use laravel-enso/roles in any Laravel application?
- No. It is not a standalone RBAC library; it is a composable module inside the Laravel Enso suite. It expects laravel-enso/core, permissions, users, and typically structure and menus to be installed. In a non-Enso codebase, the real integration cost is adopting Enso first.
- How do I install laravel-enso/roles?
- Install it with Composer only after the Enso core chain is in place. Validate core and structure first, then add users and permissions, then add roles and run Enso's migrations and seeders. Follow Enso's documented install order and publish any configuration the current release requires.
- Which Laravel and PHP versions does laravel-enso/roles support?
- The supported Laravel and PHP versions depend on the specific roles release and its matching Enso core release. Check the package composer.json and the Enso core compatibility matrix before committing. Pin every Enso package to one coordinated release line rather than mixing versions.
- How is laravel-enso/roles different from spatie/laravel-permission?
- Spatie provides a standalone flat user-to-role-to-permission model that works in most Laravel applications. laravel-enso/roles is part of an opinionated Enso suite and includes owner/role duality, Enso schema conventions, and Enso's role management UI. Choose it when Enso is already your application chassis, not as a lighter alternative to Spatie.
- Does laravel-enso/roles provide a UI for managing roles?
- Yes. The package delivers CRUD operations through Enso's own front-end scaffolding, including Enso's Vue-based role management interface. If you only need persistence and authorization semantics, you may not need the full UI layer. The UI is tightly coupled to Enso conventions.
- How does laravel-enso/roles integrate with users and permissions?
- Roles attach permissions, and users or owners are assigned roles through Enso's schema and pivots. Its models extend Enso base abstractions, so authorization flows through Enso middleware, policies, and route guards. Menus and user management also use the same role and permission data.
- Is laravel-enso/roles safe to use in production?
- It is MIT licensed and technically viable within an existing or greenfield Enso deployment. The main risks are technical and operational: a small community, tight coupling to Enso internals, and upgrade cascades when Enso core changes. It is a poor fit outside Enso or for bespoke multi-tenant authorization.
- How do I migrate existing roles and permissions to laravel-enso/roles?
- Greenfield adoption is strongly preferred and cheaper. For brownfield, freeze authorization writes, map legacy role and permission tables onto Enso's schema, backfill once, then dual-write or cut over behind a feature flag. Expect to refactor user and structure models to Enso traits, which is usually the dominant cost.
- How do I test or maintain laravel-enso/roles over time?
- Seed roles and permissions in tests and assert middleware, policies, and route guards behave correctly. Verify migrations and seeders run cleanly in a spike branch before exposing role management. For maintenance, pin the whole Enso chain with narrow constraints, forbid transitive drift in CI, and assign an owner for upstream upgrades.