Registry / auth / spatie-laravel-permission

spatie-laravel-permission

JSON →
library8.0.0phppackagistunverified

Permission handling for Laravel 12 and up

composer require spatie/laravel-permission
INSTALL
IMPORT
SIG · SPATIE-LARAVEL-PER
S
spatie-laravel-permission
authphpv8.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Role
use Spatie\Permission\Models\Role;

Creates a role and assigns a permission to it.

use Spatie\Permission\Models\Role; use Spatie\Permission\Models\Permission; $role = Role::create(['name' => 'writer']); $permission = Permission::create(['name' => 'edit articles']); $role->givePermissionTo($permission);
Debug
Known issues
breakingVersion 8.0.0 drops support for Laravel 11 and below.
fix
Use version ^7.0 if you are on Laravel 11 or earlier.
affects: >=8.0.0
Upgrade
Version history
8.0.0latest on Packagist
Audit
Dependencies

No dependency data recorded yet.

Agent activity
19 hits · last 30 days
node
16
OpenAI (training)
1
Resources