create-eloquent-builder

Installation
SKILL.md

Create Eloquent Builder

When To Use

Use this skill when reusable query logic, filtering, ordering, eager loading, search, or model-specific constraints should be centralized away from the model class.

Inputs Needed

  • Model name, query concerns, reusable filters, relationship loading needs, naming, and tests.

Workflow

  1. Inspect the model and nearby query patterns.
  2. Create a custom builder or query object when reusable query logic is needed.
  3. Keep the model focused on persistence, relations, casts, and small invariants.
  4. Move repeated query constraints out of controllers, Livewire, routes, and model methods.
  5. Name query methods like filters or capabilities, not like one-off implementation details.
  6. Use #[UseEloquentBuilder], #[UsePolicy], #[UseResource], or related Laravel attributes when they make the model contract explicit.
  7. Add tests for the query behavior.
Installs
3
GitHub Stars
1
First Seen
Jul 7, 2026
create-eloquent-builder — alizharb/agent-skills