php-laravel

Solid

Modern PHP 8.2+ and Laravel patterns: architecture, Eloquent, queues, Pest testing. Use when asked to "write PHP", "build a Laravel app", "fix Eloquent query", "add a queue job", "write a Pest test", or mentions PHP, Laravel, Eloquent, Blade, artisan, or migrations.

AI & Automation 31 stars 3 forks Updated 1 weeks ago MIT

Install

View on GitHub

Quality Score: 82/100

Stars 20%
50
Recency 20%
90
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# PHP & Laravel Development ## Code Style - `declare(strict_types=1)` in every file - Happy path last — handle errors/guards first, success at the end. Use early returns; avoid `else`. - Comments only explain *why*, never *what*. Never comment tests. If code needs a "what" comment, rename or restructure instead. - No single-letter variables — `$exception` not `$e`, `$request` not `$r` - `?string` not `string|null`. Always specify `void`. Import classnames everywhere, never inline FQN. - Validation uses array notation `['required', 'email']` for easier custom rule classes ## Modern PHP (8.2+) Use these when applicable — do not explain them in comments (Claude and developers know them): - Readonly classes and properties for immutable data - Enums with methods and interfaces for domain constants - Match expressions over switch - Constructor promotion with readonly - First-class callable syntax `$fn = $obj->method(...)` - Fibers for cooperative async when Swoole/ReactPHP not available - DNF types `(Stringable&Countable)|null` for complex constraints ## Laravel Architecture - **Fat models, thin controllers** — controllers only: validate, call service/action, return response - **Service classes** for business logic with readonly DI: `__construct(private readonly PaymentService $payments)` - **Action classes** (single-purpose invokable) for operations that cross service boundaries - **Form Requests** for all validation — never validate inline in controllers - **Events + Listen...

Details

Author
iliaal
Repository
iliaal/whetstone
Created
6 months ago
Last Updated
1 weeks ago
Language
Python
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category