Skip to content

Add a skill for Laravel Boost#40

Open
martinsoenen wants to merge 2 commits into
Lomkit:mainfrom
martinsoenen:laravel-boost-skill
Open

Add a skill for Laravel Boost#40
martinsoenen wants to merge 2 commits into
Lomkit:mainfrom
martinsoenen:laravel-boost-skill

Conversation

@martinsoenen
Copy link
Copy Markdown
Contributor

@martinsoenen martinsoenen commented May 20, 2026

Add a skill for Laravel Boost

Summary by CodeRabbit

  • Documentation
    • Added comprehensive Laravel access control documentation: activation/installation steps, authorization model and core concepts (perimeters, overlays, controls, macros, policy delegation), CLI generators, search integration notes, configuration for default scoping and query isolation, common pitfalls checklist, and practical usage guidance.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 20, 2026

Walkthrough

Adds a new comprehensive Boost skill document for lomkit/laravel-access-control describing activation checks, core authorization model (Perimeter, OverlayPerimeter, Control), HasControl macros, ControlledPolicy semantics, Scout integration constraints, configuration options, Artisan generators, and a pitfalls checklist.

Changes

Laravel Access Control Skill Documentation

Layer / File(s) Summary
Metadata and Overview
resources/boost/skills/laravel-access-control/SKILL.md
Front-matter metadata and overview explaining how the package unifies Gate policy checks with Eloquent/Scout query scoping via ControlledPolicy and HasControl macros.
Core Concepts and Activation
resources/boost/skills/laravel-access-control/SKILL.md
Activation eligibility checks, beta warning, and enumeration of when the skill applies; introduces Perimeter, OverlayPerimeter, and Control with their evaluation semantics (allowed/should/query/scoutQuery).
APIs and Installation
resources/boost/skills/laravel-access-control/SKILL.md
Documents HasControl usage (controlled()/uncontrolled() macros), ControlledPolicy delegation behavior (including viewAny/create differences), Artisan generators (make:control, make:perimeter), Scout scoutQuery constraints, and config/access-control.php options (enabled_by_default, isolate_parent_query, isolate_perimeter_queries, Gate method→verb mapping).
Patterns, Pitfalls, and Quick Reference
resources/boost/skills/laravel-access-control/SKILL.md
Collects common pitfalls and checklist: empty results when no perimeter matches, non-overlay short-circuit ordering, should skipping for viewAny/create, Scout filtering limitations, enabled-by-default test/seed behavior, and possible double evaluation in index-style flows.

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Add a skill for Laravel Boost' is generic and vague. While it describes an action (adding), it does not convey meaningful information about what specific skill is being added or what the skill is for. Clarify the title to specify the skill's purpose, such as 'Add Laravel Boost skill for laravel-access-control documentation' to better communicate the specific change.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@resources/boost/skills/laravel-access-control/SKILL.md`:
- Line 293: The lambda passed to ->should uses parameter names ($u, $m) that are
ambiguous; rename them to model-oriented names for clarity (e.g., change
->should(fn ($u, $m) => true) to ->should(fn ($user, $model) => true) or
->should(fn ($user, $post) => true)) so the second parameter clearly represents
the model in functions like should.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f90a4634-ed06-4dd1-a1c5-0433bdd166d0

📥 Commits

Reviewing files that changed from the base of the PR and between 4725bee and a039f1d.

📒 Files selected for processing (1)
  • resources/boost/skills/laravel-access-control/SKILL.md

Comment thread resources/boost/skills/laravel-access-control/SKILL.md Outdated
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@resources/boost/skills/laravel-access-control/SKILL.md`:
- Line 71: Update the documentation to clarify macro registration: state that
the HasControl trait provides the `controlled()` and `uncontrolled()` macros for
Eloquent builders (and exposes the model's Control) but that Scout's
`controlled()` macro is registered separately by `AccessServiceProvider`; also
note that `uncontrolled()` is only available on Eloquent builders and add a
cross-reference to the Scout integration section where the Scout macro
registration via `AccessServiceProvider` is described.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 76e89600-fe38-4b9b-9fe4-d393a601de78

📥 Commits

Reviewing files that changed from the base of the PR and between a039f1d and 9b19cd4.

📒 Files selected for processing (1)
  • resources/boost/skills/laravel-access-control/SKILL.md

}
```

- HasControl trait: adds `controlled()` and `uncontrolled()` macros to Eloquent (and Scout) builders and exposes the model's Control. Example usage:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify where `controlled`/`uncontrolled` macros are registered and whether `HasControl` touches Scout\Builder.
rg -n -C3 --iglob '*{HasControl,AccessServiceProvider,Scout}*.php' '\bmacro\s*\(|class\s+HasControl|Laravel\\Scout\\Builder|controlled\s*\(|uncontrolled\s*\('

Repository: Lomkit/laravel-access-control

Length of output: 3004


Clarify that Scout macro registration is handled separately from HasControl.

The phrasing "HasControl trait: adds controlled() and uncontrolled() macros to Eloquent (and Scout) builders" is misleading. Scout's controlled() macro is registered by AccessServiceProvider, not the trait. Additionally, uncontrolled() is available only on Eloquent builders. Reword to scope HasControl to Eloquent macro availability and separately reference the Scout integration section.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@resources/boost/skills/laravel-access-control/SKILL.md` at line 71, Update
the documentation to clarify macro registration: state that the HasControl trait
provides the `controlled()` and `uncontrolled()` macros for Eloquent builders
(and exposes the model's Control) but that Scout's `controlled()` macro is
registered separately by `AccessServiceProvider`; also note that
`uncontrolled()` is only available on Eloquent builders and add a
cross-reference to the Scout integration section where the Scout macro
registration via `AccessServiceProvider` is described.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant