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
- Inspect the model and nearby query patterns.
- Create a custom builder or query object when reusable query logic is needed.
- Keep the model focused on persistence, relations, casts, and small invariants.
- Move repeated query constraints out of controllers, Livewire, routes, and model methods.
- Name query methods like filters or capabilities, not like one-off implementation details.
- Use
#[UseEloquentBuilder],#[UsePolicy],#[UseResource], or related Laravel attributes when they make the model contract explicit. - Add tests for the query behavior.