sweet1s/moonshine-roles-permissions
A Laravel package for managing roles and permissions in MoonShine admin panels. It provides a ready-to-use interface to assign roles, configure permissions, and control access to resources and sections.
Architecture fit
moonshine-roles-permissions is a Laravel package that layers role/permission management onto the Moonshine admin panel. Architecturally it is a conventional Laravel package: a service provider for registration, publishable config and migrations, and Moonshine resource classes that expose role/permission CRUD in the admin UI. It almost certainly wraps spatie/laravel-permission as the underlying authorization engine rather than implementing its own — that needs confirmation, but it is the dominant pattern for this class of package and determines most of the integration surface.
Fit is conditional and narrow: it is a good fit only for applications already committed to Moonshine as their admin layer. For Laravel apps using Nova, Filament, or custom admin UIs, the package delivers nothing — the value is entirely in the Moonshine resource wiring.
Integration feasibility
Straightforward on a greenfield Moonshine v4 project: composer require, publish assets, run migrations, seed the initial super-admin role. The friction is concentrated in version alignment. Release 4.0.0 is a major bump whose only documented change is "added support for Moonshine v4" — this is lockstep versioning, meaning the package's major version tracks the upstream Moonshine major version. That is a reasonable convention but it means the package cannot be evaluated independently of the host application's Moonshine version.
Technical risk
Key questions
composer.json constraints — does 4.0.0 require Moonshine ^4.0 only, or does it support v3 and v4 simultaneously?spatie/laravel-permission a hard dependency, and which major version? A mismatch here causes silent permission-check failures.Stack fit
Target stack is PHP 8.1+, a currently supported Laravel major, Moonshine 4.x, and spatie/laravel-permission. The package is only viable where Moonshine is the admin layer; treat that as a hard prerequisite rather than an assumption to revisit later.
Migration path Two distinct paths depending on starting state:
roles, permissions, model_has_roles, and model_has_permissions before running any migration, and diff row counts and pivot contents afterward.Compatibility
Because 4.0.0 carries no published compatibility matrix, derive it empirically: read composer.json constraints for moonshine/*, laravel/framework, spatie/laravel-permission, and PHP, then validate in a throwaway branch. Treat any published config file as a diff target — compare the vendor default against the app's published copy before upgrading.
Sequencing
Do not bundle this with unrelated Moonshine resource work — the upgrade needs a clean blast radius.
Maintenance
Ongoing cost is low in code terms but carries a standing upgrade tax: the package must be bumped whenever Moonshine ships a major release, and the team absorbs that coordination work. Ownership should sit with whoever owns the admin panel, with the dependency pinned to an exact minor version rather than a floating constraint — this is not a package to allow ^4.0 drift on, given the absence of a test matrix.
Support Expect self-service. Documentation is likely thin, the changelog is one line and non-English, and upstream issue response is not a schedule you can plan against. Budget for reading the package source when behavior is unclear — it is a small codebase, which makes this tractable, but it is real time.
Scaling
The performance profile is inherited from spatie/laravel-permission: permission lookups are cached, so steady-state request cost is negligible. The scaling concern is not throughput but cache correctness — invalidation must fire on every role/permission mutation path, including any seeders, queued jobs, or direct DB writes that bypass the package's UI. Admin-panel scale is inherently low-traffic, so this is a correctness risk, not a capacity risk.
Failure modes
Ramp-up
For a Laravel developer already fluent in spatie/laravel-permission, ramp-up is under a day — the concepts transfer directly and only the Moonshine resource wiring is new. For a team without that background, add time for Moonshine's resource/policy conventions specifically. Either way, the practical onboarding artifact is a short internal runbook covering the upgrade sequencing above, since upstream will not provide one.
How can I help you explore Laravel packages today?