Увійти Реєстрація
Блог Серії
Кар'єра
Вакансії Компанії
Навчання
Документація Співбесіди Тестування Відео
Екосистема
Пакети Ресурси Проєкти Події
Інше
Про нас

Laravel Permission

spatie/laravel-permission
8.3.0 13 12,948 111.6M 3 липня 2026
На GitHub

Управління дозволами та правами доступу для Laravel 12 та новіших версій.

28

README

Logo for laravel-permission

Associate users with permissions and roles

Latest Version on Packagist GitHub Tests Action Status Total Downloads

Documentation, Installation, and Usage Instructions

See the documentation for detailed instructions for how-to-use, as well as installation and upgrade guidance.

What It Does

This package allows you to manage user permissions and roles in a database.

Once installed you can do stuff like this:

// Adding permissions to a user
$user->givePermissionTo('edit articles');

// Adding permissions via a role
$user->assignRole('writer');

$role->givePermissionTo('edit articles');

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:

$user->can('edit articles');

Support us

We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Testing

composer test

Security

If you discover any security-related issues, please email security@spatie.be instead of using the issue tracker.

Postcardware

You're free to use this package, but if it makes it to your production environment we highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using.

Our address is: Spatie, Kruikstraat 22, 2018 Antwerp, Belgium.

We publish all received postcards on our company website.

Credits

This package is heavily based on Jeffrey Way's awesome Laracasts lessons on permissions and roles. His original code can be found in this repo on GitHub.

Special thanks to Alex Vanderbist who greatly helped with v2, and to Chris Brown for his longtime support helping us maintain the package.

Special thanks to Caneco for the original logo.

Alternatives

License

The MIT License (MIT). Please see License File for more information.

Коментарі

Увійдіть, щоб залишити коментар

Будьте першим, хто залишить коментар!

Схожі пакети

Laravel Activitylog

spatie/laravel-activitylog

Простий логер активності для моніторингу користувачів вашого веб-сайту або додатку.

5,879 5.1.0 13 20

Laravel Socialite

laravel/socialite

Вхід через Google, GitHub, Facebook, X та інші OAuth-провайдери. Ховає різницю між їхніми API за єдиним інтерфейсом; десятки додаткових провайдерів доступні через Socialite Providers.

5,746 v5.30.0 13 2

Laravel Jetstream

laravel/jetstream

Розширений стартовий набір поверх Fortify: команди, керування профілем, API-токени, двофакторка та сесії пристроїв. Для проєктів, де багатокористувацькі команди потрібні від першого дня.

4,056 v5.5.3 13 2

Bouncer

josephsilber/bouncer

Пакет для управління ролями та дозволами через Eloquent ORM.

3,579 v1.0.4 13 11

Laravel Passport

laravel/passport

Повноцінний OAuth2-сервер для Laravel за лічені хвилини. Потрібен, коли ваш API споживають сторонні застосунки і треба видавати їм токени з grant-флоу.

3,412 v13.7.6 13 2

Laravel Breeze

laravel/breeze

Мінімальний стартовий набір автентифікації: Blade, Livewire або React/Vue через Inertia. Публікує звичайний, зрозумілий код у ваш застосунок, який далі правите як свій.

3,047 v2.4.2 13 1