Download the PHP package lathe/permission without Composer
On this page you can find all versions of the php package lathe/permission. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download lathe/permission
More information about lathe/permission
Files in lathe/permission
Package permission
Short Description Roles and permissions for Lathe, built on spatie/laravel-permission.
License MIT
Homepage https://lathephp.com
Informations about the package permission
lathe/permission
Roles and permissions from spatie/laravel-permission, managed in the Lathe panel.
Install
Add Spatie\Permission\Traits\HasRoles to your User model. Lathe discovers the plugin from the package's composer.json, so there is no registration step.
Opt in
Nobody may manage roles or permissions until the app opts in. Register the plugin with the shipped policies, which let every user who passes viewLathe manage both and log one boot warning per policy class:
Or register your own policies:
A plugin you register by hand wins over the discovered one. useRoleResource() and usePermissionResource() swap in your own Resources.
Cache
Saving or deleting a role or a permission flushes Spatie's permission cache, so a change made in the panel applies on the next request.
Known limits
- A host table named
rolesorpermissionscollides with Spatie's tables. - A host Resource with the uriKey
rolesorpermissionsstops the panel from booting withResourceUriKeyCollisionException. Point the plugin at it withuseRoleResource()orusePermissionResource().
Development
This repository is a read-only copy of plugins/permission in lathephp/lathe, where the plugin is developed and released together with Lathe. Send issues and pull requests there.
To run the plugin's own checks here:
CI runs the tests on PHP 8.4 and 8.5, each on the highest versions and after composer update --prefer-lowest (spatie/laravel-permission 7.x).