Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Permission Checker

Permission Checker Laravel Package

keboola/permission-checker

A PHP library from Keboola for checking user permissions and access rights. It helps applications determine whether a user is allowed to perform actions on resources, supporting simple access-control integration in Keboola-based projects.

Deep Wiki
Context7

[READ-ONLY] Token permission checker

Frequently asked questions about Permission Checker
What is keboola/permission-checker used for?
keboola/permission-checker is a lightweight PHP library for evaluating whether a user, role, or resource is granted a specific permission. It separates declarative permission definitions from the actual access checks, so rules are declared once and queried consistently. Each check returns a clear boolean result and can also collect denied reasons, which makes refusals easier to explain or log.
How do I install keboola/permission-checker with Composer?
Install it with Composer by running composer require keboola/permission-checker. Because the core is framework-agnostic, there is no mandatory service provider or config file to publish. In a Laravel application, resolve the checker through the service container or inject it into your own services.
Does keboola/permission-checker work with Laravel, and which Laravel versions are supported?
Yes. The core is framework-agnostic and has no Laravel coupling, so it integrates with Laravel services through dependency injection rather than a Laravel-specific API. Version support therefore depends on the library's PHP requirement rather than a specific framework release. Check the composer.json constraints on Packagist before upgrading PHP or Laravel.
How do I get the reason a permission check was denied?
The checker can collect denied reasons alongside the boolean result, so instead of a bare false you get an explanation of why access was refused. Use that data in error responses, logs, or audit entries. If you need a specific message shape, format the collected reasons in your own application layer.
Can I check permissions for roles and resources, not just users?
Yes, the library is designed for allow and deny checks against users, roles, and resources. Permission rules are declared separately from business logic, so the same rule set can answer checks for different subjects. That keeps role-based and resource-based authorization consistent across the application.
How do I test permission rules built with keboola/permission-checker?
Because rules are declarative and the checks are composable, you can unit test them as plain PHP without booting Laravel. Define your rules, run the checks with representative subjects, and assert both the boolean outcome and the collected denied reasons. Keeping permission definitions out of controllers makes those tests fast and focused.
Is keboola/permission-checker a replacement for Laravel Gate and policies?
Not exactly. Laravel Gate and policies are framework features tied to the authenticated user and Laravel's authorization pipeline, while keboola/permission-checker is a standalone PHP library focused on declarative rules and reason reporting. You can use it alongside Gate, for example inside a policy or dedicated service, when you want reusable checks that also work outside Laravel.
What are alternatives to keboola/permission-checker?
Common alternatives include Laravel's built-in Gate and policies and packages such as spatie/laravel-permission. Those usually persist roles and permissions in a database and are Laravel-specific, whereas keboola/permission-checker is a framework-agnostic evaluation library that focuses on checking rules rather than storing role assignments. Choose based on whether you need persistence and deep framework integration or a small, portable rule-checking core.
Can I log authorization decisions with keboola/permission-checker?
Yes. The denied-reason output is intended to support audit logging and to explain why access was refused. Log each decision together with the subject, the permission being checked, and the collected reasons, ideally in a structured channel. The library returns decisions only, so the actual logging implementation stays in your application.
Is keboola/permission-checker production-ready and actively maintained?
It is a lightweight library with no framework lock-in, which keeps its runtime surface small, and it is published by Keboola for use in Keboola-based projects. Check Packagist for the latest release and commit history before adopting it, and pin a version in composer.json. Because authorization behaviour is security-relevant, cover your rules with tests and log denials in production.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle
adachsoft/api-version-bundle
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
cgv/localized-resource