This commit is contained in:
Muhammad Tamir
2025-11-14 10:59:24 +07:00
parent 85c03cef82
commit b3933b9960
505 changed files with 13811 additions and 2341 deletions

View File

@@ -27,4 +27,17 @@ class UserResource extends JsonApiResource
'credits' => CreditResource::class,
'role' => RoleResource::class,
];
public function toMeta($request): array
{
// Is properties loaded?
$meta = [];
if ($this->resource->relationLoaded('properties')) {
$meta['properties'] = $this->resource->properties->mapWithKeys(function ($property) {
return [$property->key => $property->value];
});
}
return $meta;
}
}