Loading...
Loading...
Apply Spatie's Laravel and PHP coding standards for any task that creates, edits, reviews, refactors, or formats Laravel/PHP code or Blade templates; use for controllers, Eloquent models, routes, config, validation, migrations, tests, and related files to align with Laravel conventions and PSR-12.
npx skill4agent add spatie/guidelines-skills spatie-laravel-php.php.blade.php.php.blade.phpreferences/spatie-laravel-php-guidelines.mdvoid?stringuseelse[Controller::class, 'method']PostsControllerconfig()env()config/services.php__()@langfinalreadonlyelse// Happy path last with early returns
if (! $user) {
return null;
}
if (! $user->isActive()) {
return null;
}
// Process active user...
// Short ternary
$name = $isFoo ? 'foo' : 'bar';
// Constructor property promotion
class MyClass {
public function __construct(
protected string $firstArgument,
protected string $secondArgument,
) {}
}@if($condition)
Something
@endifreferences/spatie-laravel-php-guidelines.md