D
developing-shopper
Provides coding standards and patterns for Laravel Shopper development. Use when creating or modifying Models, Actions, Enums, Livewire components, migrations, or tests in any Shopper package.
Installation
Pick a client and clone the repository into its skills directory.
Installation
About this skill
Provides coding standards and patterns for Laravel Shopper development. Use when creating or modifying Models, Actions, Enums, Livewire components, migrations, or tests in any Shopper package.
How to use
- Zainstaluj skill w swoim projekcie Laravel Shopper — dodaj go do konfiguracji agenta lub MCP servera obsługującego skill'e Shopper.
- Gdy tworzysz nowy plik PHP w projekcie, zacznij od wymaganego nagłówka:
<?php declare(strict_types=1);— skill przypomni ci o tej konwencji. - Podczas definiowania klasy (Model, Action, Enum lub Livewire component) zapoznaj się z kolejnością elementów: cechy (traits), przypadki (cases), stałe, właściwości, konstruktor, metody magiczne, a następnie metody publiczne, chronione i prywatne.
- Dla modeli: implementuj interfejs kontraktu (np. ProductContract), używaj cech HasFactory i HasModelContract, zdefiniuj configKey() i getTable() z funkcją shopper_table(), oraz dodaj rzutowania w metodzie casts().
- Dla akcji: utwórz klasę final z metodą execute() realizującą jedną odpowiedzialność — skill pomoże ci utrzymać czystość kodu.
- Dla enumów: implementuj interfejsy HasColor, HasLabel, HasIcon, używaj cech ArrayableEnum i HasEnumStaticMethods, oraz zwracaj przetłumaczone etykiety z __() w getLabel().