← Laravel és Vue alapok csapata adatlapja

Skill · 1.0.0 verzió

Laravelhez illő megvalósítás

Meglévő konvenciókkal választja el a validálás, jogosultság, üzleti szabály és HTTP-kezelés feladatát.

laravel-conventions

Ezt a skillt használó csapattagok

Nézd meg, miben segít

Mikor hasznos?

Akkor használd, ha új funkciót illesztesz az alkalmazásba felesleges rétegek nélkül.

Miben segít neked?

  • Karcsú vezérlőt és bevett üzletiszabály-elhelyezést alkalmaz.
  • Függőséginjektálást és gyorsítótárazott beállítással is működő konfigurációt használ.
  • Elnevezett útvonalakat, pontos típusokat és egységes kivételkezelést követ.

Például ezt kérheted

Valósítsd meg a rendeléslemondást meglévő action mintával, policyval és értelmezhető ütközési válasszal. Feladás előtt és után is próbálj lemondást. Maradjon a meglévő válaszformátum és feladott rekord, az ütközés pedig legyen elmagyarázható a felhasználónak.

Részletes dokumentáció

Itt a skill eredeti útmutatóját, példáit és ellenőrzési szempontjait olvashatod az eredeti nyelven.

Részletek…Összecsukás

Idiomatic Laravel Development

Architecture and responsibilities

  • Keep controllers focused on HTTP orchestration: receive a validated Form Request, authorize the action, delegate non-trivial business rules to the layer the project uses (domain methods, Action classes or Services), and return a response, View, Redirect or JsonResource.
  • Separate input validation, authorization and business rules so each has one clear home and can run in HTTP, CLI and queue contexts.
  • Do not introduce repositories, service layers or interfaces with a single implementation unless the project already uses that pattern or the complexity warrants it.
  • Generate scaffolding with php artisan make:* (--no-interaction) so namespaces and stubs match the app. Never edit files in vendor/.

Container, config and environment

  • Prefer constructor dependency injection and typed contracts over app() service location in application code. Register bindings and singletons in Service Providers.
  • Call env() ONLY inside config/*.php; in application code always read config('service.key') because env() returns null when config is cached. Document new environment variables in .env.example.

Routing, errors and PHP style

  • Use named routes (route('orders.show', $order)), route model binding, and Route::resource / Route::apiResource where CRUD fits.
  • Use custom domain exceptions (report() / render() or centralized exception handling in bootstrap/app.php / Handler.php) instead of catching generic \Exception and returning ad-hoc error arrays.
  • Add explicit parameter and return types, constructor property promotion, and PHP BackedEnums (string or int) for status/type sets. Format with vendor/bin/pint --dirty when Pint is present.

Csomagban lévő fájlok 2

  • LICENSE.txt
  • SKILL.md