php-laravel
Skill2 starsChanged 4 months agoMITView on GitHub
When to use: PHP or Laravel work — Eloquent, middleware, validation, queues, migrations, testing.
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 22
Use Form Request classes for complex validation, not inline $request->validate()
- Very specific: line 38
Never dropColumn() in production without a data backup plan
- Very specific: line 39
Always write down() migration and test it
- Distinctive: line 40
Add indexes for columns used in WHERE clauses
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
PHP / Laravel Skill
When to use: PHP or Laravel work — Eloquent, middleware, validation, queues, migrations, testing.
Eloquent gotchas
- N+1 queries — use
with()for eager loading.$users->postsin a loop = N+1.User::with('posts')->get()= 2 queries. - Mass assignment — always use
$fillable(allowlist), not$guarded = [](denylist of nothing) - Soft deletes —
Model::all()excludes soft-deleted by default. If you need them:withTrashed(). Know which you want. - Accessor performance — never put a query inside an accessor/getter. It runs on every access.
- Check-then-write — use
firstOrCreate()/updateOrCreate()instead ofif (!exists) create. Avoids race conditions.
Middleware patterns
- Apply auth middleware at the route group level, not per-route (easy to forget one)
- Rate limiting on auth endpoints:
throttle:5,1minimum - CORS configured at middleware level, not in individual controllers
- Order matters: auth before authorization before validation
Form request validation
- Use Form Request classes for complex validation, not inline
$request->validate() authorize()method for permission checks — returnstrue/false- Custom error messages for user-facing forms
sometimesrule for optional fields that should validate only when present
Queue / job patterns
- Idempotency — jobs must be safe to retry. Use unique IDs or idempotency keys.
- Set
$triesand$timeouton every job. Defaults are rarely correct. - Implement
failed()method for cleanup on permanent failure - Unique locks —
ShouldBeUniqueinterface when duplicate dispatch is harmful - Backoff — use
$backoffproperty for exponential retry delays
Migration safety
- New columns: always
nullable()or->default()— never break existing rows - Never
dropColumn()in production without a data backup plan - Always write
down()migration and test it - Add indexes for columns used in WHERE clauses
- Separate migration deploy from code deploy when possible (expand/contract pattern)
Testing
- Feature tests for HTTP endpoints (test the full request/response cycle)
- Unit tests for services and business logic (no framework, no database)
- Database transactions — use
RefreshDatabaseorDatabaseTransactionstrait - Factories for test data — never hardcode IDs or rely on seeders
- Pest preferred over PHPUnit for readability, but both work
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- iliaal/ai-skills★ 45same name
- muxammadmamajonov/dot-claude★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository9 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/paw.mdcCursor rule
- architectureSkill
- devils-advocateSkill
- frontendSkill
- git-safetySkill
- quality-gateSkill
- securitySkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

