We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/brianirish/laravel-docs-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
# Spatie - Api/Models
Source: https://spatie.be/docs/laravel-permission/v6/api/models
laravel-permission
==================
Associate users with roles and permissions
Docs
Laravel-permission
Introduction
You are viewing the documentation for **an older version** of this package.
You can check the version you are using with the following command:
`composer show spatie/laravel-permission`
Laravel Permission
==================
Associate users with roles and permissions
------------------------------------------
Use this package to easily add permissions or roles to users in your Laravel app.
Repository
Open Issues
Introduction
------------
This package allows you to manage user permissions and roles in a database.
Once installed you can do stuff like this:
```php
// Adding permissions to a user
$user->givePermissionTo('edit articles');
// Adding permissions via a role
$user->assignRole('writer');
$role->givePermissionTo('edit articles');
```
If you're using multiple guards we've got you covered as well. Every guard will have its own set of permissions and roles that can be assigned to the guard's users. Read about it in the using multiple guards section.
Because all permissions will be registered on Laravel's gate, you can check if a user has a permission with Laravel's default `can` function:
```php
$user->can('edit articles');
```
and Blade directives:
```php
@can('edit articles')
...
@endcan
```
About us
Support us
Help us improve this page