Create, modify, review, or test the Vendra Custom Page JSON:API package in packages/vendra-custom-page-api, including custom page and category schemas, resources, query validation, relationships, routes, and provider wiring.
설치
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
Create, modify, review, or test the Vendra Custom Page JSON:API package in packages/vendra-custom-page-api, including custom page and category schemas, resources, query validation, relationships, routes, and provider wiring.
Vendra Custom Page API
Use this skill together with laravel-best-practices and pest-testing.
Translatable Persistence
Making a persisted model field translatable is an explicit domain choice unless this package already requires it.
Every field listed in a model's $translatable array must definitely use a JSON database column. Keep its model traits/casts, factories, validation, Filament locale UI, API serialization, and tests translation-aware.
A field not listed in $translatable must use the appropriate scalar database type and must not use Spatie Translatable, translatable slug traits, locale switchers, translated callbacks, or translation-shaped array data.
Module Boundary
Keep API code in packages/vendra-custom-page-api under Misaf\VendraCustomPageApi.
Depend on Misaf\VendraCustomPage models; do not duplicate models, migrations, factories, policies, or Filament UI.
Inherit tenant scoping from domain models and never reference Misaf\VendraTenant in production code.
Do not require misaf/vendra-localization or attach vendra.locale; the host application owns optional locale resolution.
JSON:API Contract
Register the vendra-custom-page server at /v1.
Keep custom-page-categories and custom-pages read-only.
Expose translated JSON columns with ArrayHash and serialize them with getTranslations().
Validate query-string booleans with JsonApiRule::boolean()->asString().
Keep with-trashed and only-trashed synchronized between collection queries and schemas.
Represent the domain models' MorphMany multimedia relations with JSON:API HasMany.
Keep customPages, customPageCategory, and multimedia relationship names aligned with domain methods.
Keep filters and collection query validation synchronized, including locale-aware name/slug filters, status, soft deletes, relationships, multimedia, pagination, sparse fields, and sorting.
Verification
Test route registration, server schema registration, relationship endpoints, and architecture.
Run package Pest tests, PHPStan, Composer validation, and Pint.