Reference
PHP attributes
The attributes read on resources and models.
| Attribute | On | Effect |
|---|---|---|
#[Ark4ne\JsonApi\Resources\Attributes\JsonApiType('posts')] | a resource | Its type, without toType() |
#[Ark4ne\JsonApi\Resources\Attributes\JsonApiModel(Post::class)] | a resource | Its model, to guess the resources of its relationships (default: the naming convention) |
#[Ark4ne\JsonApi\Resources\Attributes\JsonApiRoutes(self: 'posts.show', relationship: …, related: …)] | a resource | Links from routes, see Links by route |
#[Ark4ne\JsonApi\Definition\JsonApiSince(ApiRevision::X)] | a resource | The resource exists from the revision included; not inherited |
#[Ark4ne\JsonApi\Definition\JsonApiUntil(ApiRevision::X)] | a resource | The resource exists up to the revision included; not inherited |
#[Illuminate\Database\Eloquent\Attributes\UseResource(UserResource::class)] | a model | The resource of the model when a relationship is guessed |