v1.4.0
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user