# Laravel Access Control 1.x > Laravel Access Control (lomkit/laravel-access-control) is a Laravel package that declares in one control who can see and change each Eloquent model: its perimeters drive the policies, the query scopes and the Scout searches. It is for Laravel developers who need each user to reach only some rows of a model, such as the rows of their tenant, of their team or their own rows, and runs on PHP 8.3+ and Laravel 13. ## Documentation Sets - [Laravel Access Control 1.x: full documentation](https://laravel-access-control.lomkit.com/llms-full.txt): Every page of the current version (1.x) in one Markdown file. ## Using these docs with an AI assistant These docs describe Laravel Access Control 1.x, the current version (latest release 1.0.0). Write 1.x code from them. Every page below is a Markdown copy of the site page. The package ships a Laravel Boost skill named `laravel-access-control`. Assistants that support MCP can also read these docs through GitMCP, https://lomkit.gitmcp.io/laravel-access-control-doc, or through Context7 as the library `/lomkit/laravel-access-control-doc`. - [Use with AI](https://laravel-access-control.lomkit.com/raw/digging-deeper/use-with-ai.md): The Laravel Boost skill, llms.txt, the Markdown copies, GitMCP and Context7. - [Laravel Boost skill](https://github.com/Lomkit/laravel-access-control/blob/1.x/resources/boost/skills/laravel-access-control/SKILL.md): The feature reference that the package gives to coding assistants through Laravel Boost. ## When to use it Laravel Access Control fits a Laravel application where users reach only some rows of a model: the rows of their tenant, of their client, of their team, or their own rows, with rights that differ by ability. It suits list screens, exports and searches that must show exactly the rows that the policy allows. It does not store roles or permissions: its `allowed()` callbacks read them from the application, such as `$user->can()` with a permission package. It decides which rows a user reaches, not which attributes of a row they see. When access depends on the ability alone, never on the row, a plain Laravel policy is enough. The Introduction page below lists its requirements and compares it with Laravel policies, spatie/laravel-permission and PostgreSQL row-level security. ## Getting Started - [Introduction](https://laravel-access-control.lomkit.com/raw/getting-started/introduction.md): What Laravel Access Control does, how one control per model drives your policies, queries and searches, when it fits, and how it compares. - [Installation](https://laravel-access-control.lomkit.com/raw/getting-started/installation.md): Requirements of Laravel Access Control 1.x and how to install it with Composer. - [Quick start](https://laravel-access-control.lomkit.com/raw/getting-started/quick-start.md): Control your first model in four steps, from the perimeter classes to the policy and the controlled queries. - [Upgrade guide](https://laravel-access-control.lomkit.com/raw/getting-started/upgrade-guide.md): Move an application from Laravel Access Control 0.x to 1.0, area by area, with a link to the page that explains each new way. ## Essentials - [Controls](https://laravel-access-control.lomkit.com/raw/essentials/controls.md): A control declares the access to one Eloquent model. Learn how to write one, how the package finds it, and how to link it to its model. - [Perimeters](https://laravel-access-control.lomkit.com/raw/essentials/perimeters.md): A perimeter is one access rule of a control. allowed() is the permission, query() gives the rows for the lists, should() checks one row. - [Perimeter classes](https://laravel-access-control.lomkit.com/raw/essentials/perimeter-classes.md): Every perimeter is a class of your application. Keep its rules as callbacks in the control, or write them once in the class, with protected hooks and variants. - [Levels](https://laravel-access-control.lomkit.com/raw/essentials/levels.md): Levels::of() declares a hierarchy of perimeters, widest first, where only the highest level a user reaches applies. Perimeters outside a group add up. - [Boundaries](https://laravel-access-control.lomkit.com/raw/essentials/boundaries.md): A boundary is a condition that every row must meet, whatever the perimeter that grants it, such as the tenant or the workspace of the user. - [Parents](https://laravel-access-control.lomkit.com/raw/essentials/parents.md): ThroughParent gives a child row the access of its parent, such as a comment that whoever may view its post may view, through the control of the parent. - [Policies](https://laravel-access-control.lomkit.com/raw/essentials/policies.md): Access::registerPolicies() gives every controlled model a policy built on its control. Learn how it decides, its refusal codes, drafts and business abilities. - [Queries](https://laravel-access-control.lomkit.com/raw/essentials/queries.md): controlled(), controlledFor() and uncontrolled() filter your Eloquent queries in SQL with the control of the model. A query is controlled only when it says so. - [Readers](https://laravel-access-control.lomkit.com/raw/essentials/readers.md): The reader is the model a decision is made for. Learn about readers of several types, the decision context, and the decisions kept for a request. ## Search - [Search overview](https://laravel-access-control.lomkit.com/raw/search/overview.md): A controlled Laravel Scout search keeps, in one engine query, the documents the reader may view: each document carries the keys that open it. - [Engines](https://laravel-access-control.lomkit.com/raw/search/engines.md): Declare the access attributes in Meilisearch, Typesense, Algolia or Turbopuffer, use the database engine, and combine your own filters with the access filter. - [Keeping the keys fresh](https://laravel-access-control.lomkit.com/raw/search/keeping-the-keys-fresh.md): Search keys are computed at indexing time. Declare with reindexWhen() and ReindexesSearch what reindexes the documents when the data behind them changes. - [Exceptions and dates](https://laravel-access-control.lomkit.com/raw/search/exceptions-and-dates.md): Write a rule with exceptions as positive search keys, and a right that holds during a period with the clock read on the reader side, never on the row side. - [Searching through a parent](https://laravel-access-control.lomkit.com/raw/search/through-a-parent.md): A searchable child declared with ThroughParent is found through the keys of its parent, and its documents follow the changes of the parent. - [Search from the browser](https://laravel-access-control.lomkit.com/raw/search/from-the-browser.md): Let a front end search Meilisearch, Typesense or Algolia with a signed token that holds the reader's filter, or through an application route that guards it. - [Your own search client](https://laravel-access-control.lomkit.com/raw/search/your-own-client.md): Keep the access filter when you query the search engine with your own client, or feed your own index with Access::indexKeysOf() and Access::indexReaderKeys(). ## Integrations - [laravel-rest-api](https://laravel-access-control.lomkit.com/raw/integrations/laravel-rest-api.md): With laravel-rest-api 3.6+, AccessControlExtension applies your controls to every resource of a controlled model, its text searches and row checks included. ## Testing and Tooling - [Testing](https://laravel-access-control.lomkit.com/raw/testing-and-tooling/testing.md): The InteractsWithAccess assertions prove on your test data that the levels nest, the policy and the queries agree, and the search finds what the SQL lists. - [access:check](https://laravel-access-control.lomkit.com/raw/testing-and-tooling/access-check.md): php artisan access:check builds every control and reports in CI what would throw, open or hide rows, or leave search documents stale. - [Cache and about](https://laravel-access-control.lomkit.com/raw/testing-and-tooling/cache-and-about.md): Cache the control of each model with access:cache in every deployment, and read the state of the package in the Access Control section of php artisan about. - [Generators](https://laravel-access-control.lomkit.com/raw/testing-and-tooling/generators.md): make:control and make:perimeter scaffold the controls and the perimeter classes, from stubs that you can publish and change. ## Digging Deeper - [Abilities](https://laravel-access-control.lomkit.com/raw/digging-deeper/abilities.md): The Ability value object names what a reader wants to do: how a policy method maps to an ability, how to change the mapping, and how business abilities work. - [Kept decisions](https://laravel-access-control.lomkit.com/raw/digging-deeper/decisions.md): What the package keeps within a request or a job, what forgets it, the writes of Laravel's own tables that do not, and when to call Access::forgetDecisions(). - [Batched decisions](https://laravel-access-control.lomkit.com/raw/digging-deeper/batched-decisions.md): Decide the rows of a page in one query with withAbilities(), preload decisions with Access::preload(), or get the keys a reader may act on with reachableKeys(). - [Row checks](https://laravel-access-control.lomkit.com/raw/digging-deeper/row-checks.md): How the policy checks one row, in memory or in one SQL query, and how a control or a perimeter tells which perimeters apply and which one grants a row. - [Several brands](https://laravel-access-control.lomkit.com/raw/digging-deeper/several-brands.md): List the rows of several brands, tenants or companies in one query with perimeters that read the brand of the row, and know when a parent needs the row's brand. - [Row context](https://laravel-access-control.lomkit.com/raw/digging-deeper/row-context.md): Decide the parent of a ThroughParent in the brand or tenant of each child row with decidedInRowContext() and Access::rowContextUsing(), and test the switch. - [What is public in 1.x](https://laravel-access-control.lomkit.com/raw/digging-deeper/public-api.md): The releases of 1.x follow semantic versioning for what this documentation describes. Learn what that covers, and what may change in any release. - [Use with AI](https://laravel-access-control.lomkit.com/raw/digging-deeper/use-with-ai.md): Give coding assistants the current Laravel Access Control docs: the Laravel Boost skill, llms.txt, Markdown copies of every page, GitMCP and Context7.