Przejdź do treści
Biblioteka skilli
Programowanie · Budowanie i kod

spatie-laravel-php

/spatie-laravel-php

Stosuje standardy kodowania Spatie dla Laravela i PHP przy kontrolerach, modelach, migracjach, testach i szablonach Blade.

Licencja
MIT
Ostatnia zmiana repozytorium
22.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
2
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 22.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Stosuje standardy kodowania Spatie dla Laravela i PHP przy kontrolerach, modelach, migracjach, testach i szablonach Blade.

Oryginalny opis (EN)

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.

Jak działa

  1. Overview
  2. When to Activate
  3. Scope
  4. Workflow
  5. Core Rules (Summary)
  6. Do and Don't
  7. Examples
  8. References
Sekcje z nagłówków SKILL.md, w oryginale · 86 linii, 443 słów
Podgląd SKILL.md
---
name: spatie-laravel-php
description: 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.
license: MIT
metadata:
  author: Spatie
---

# Spatie Laravel & PHP Guidelines

## Overview
Apply Spatie's Laravel and PHP guidelines to keep code style consistent and Laravel-native.

## When to Activate
- Activate this skill for any Laravel or PHP coding work, even if the user does not explicitly mention Spatie.
- Activate this skill when asked to generate, edit, format, refactor, review, or align Laravel/PHP code.
- Activate this skill when working on `.php` or `.blade.php` files, routes, controllers, models, config, validation, migrations, or tests.

## Scope
- In scope: `.php`, `.blade.php`, Laravel conventions (routes, controllers, config, validation, migrations, tests).
- Out of scope: JS/TS, CSS, infrastructure, database schema design, non-Laravel frameworks.

## Workflow
1. Identify the artifact (controller, route, config, model, Blade, test, etc.).
2. Read `references/spatie-laravel-php-guidelines.md` and focus on the relevant sections.
3. Apply the core Laravel principle first, then PHP standards, then section-specific rules.
4. If a rule conflicts with existing project conventions, follow Laravel conventions and keep changes consistent.

## Core Rules (Summary)
- Follow Laravel conventions first.
- Follow PSR-1, PSR-2, and PSR-12.
- Prefer typed properties and explicit return types (including `void`).
- Use short nullable syntax like `?string`.
- Use constructor property promotion when all properties can be promoted.
- One trait per line with separate `use` statements.
- Once a method chain breaks across lines, put every subsequent `->` on a new line; never mix single-line and multi-line chaining.
- Prefer early returns and avoid `else` when possible.
- Always use curly braces for control structures.
- Use string interpolation over concatenation.
- Happy path last: handle error conditions first.

## Do and Don't
Do:
- Use kebab-case URLs, camelCase route names, and camelCase route parameters.
- Use tuple notation for routes: `[Controller::class, 'method']`.
- Use plural resource names for controllers (`PostsController`).
- Use array notation for validation rules.
- Use `config()` helper and avoid `env()` outside config files.
- Add service configs to `config/services.php`, not new files.
- Use `__()` for translations instead of `@lang`.
- Use PascalCase for enum values and class constants.

Don't:
- Add docblocks when full type hints already exist.
- Use fully qualified classnames in docblocks.
- Use `final` or `readonly` by default.
- Use `else` when early returns work.
- Add spaces after Blade control structures.

## Examples
```php
// 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,
    ) {}
}
```

```blade
@if($condition)
    Something
@endif
```

## References
- `references/spatie-laravel-php-guidelines.md`
Pliki w paczce (2)
  • SKILL.md 3 KB
  • references/spatie-laravel-php-guidelines.md 10 KB

Wersje

W bazie nie ma innych skilli o nazwie spatie-laravel-php.

Migawka bazy z 28.10.2026 · wersja paczki 7bac8c07b761 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 90spatie-javascript
    Stosuje standardy kodowania JavaScript i TypeScript Spatie: deklaracje zmiennych, porównania, funkcje i konfigurację Prettier.
  • 95developing-with-laravel
    Opisuje wzorce frameworka Laravel dla aplikacji PHP: Eloquent ORM, migracje, routing, kolejki i szablony Blade.
  • 90php-laravel
    Opisuje nowoczesne wzorce PHP 8.4 i Laravel: architekturę, Eloquent, migracje, kolejki i testowanie, przy pracy z Blade, artisan i aplikacjami PHP opartymi na frameworku.
  • 90php-laravel
    Pisze aplikacje w PHP 8.2+ i Laravelu: Eloquent, kolejki, widoki Blade, migracje i testy w Pest.
  • 90laravel-best-practices
    Stosuje dobre praktyki Laravel przy kontrolerach, modelach, migracjach, zapytaniach Eloquent, cachowaniu, autoryzacji i kolejkach.
  • 90laravel-best-practices
    Pilnuje dobrych praktyk Laravel przy kontrolerach, modelach, zapytaniach N+1, walidacji, kolejkach i autoryzacji.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.