Attempt to fix Fractal object type being null
This commit is contained in:
parent
507a802dec
commit
8fff0846a0
3 changed files with 47 additions and 36 deletions
|
@ -6,17 +6,6 @@ use League\Fractal\Serializer\ArraySerializer;
|
|||
|
||||
class PterodactylSerializer extends ArraySerializer
|
||||
{
|
||||
/**
|
||||
* Serialize an item.
|
||||
*/
|
||||
public function item(?string $resourceKey, array $data): array
|
||||
{
|
||||
return [
|
||||
'object' => $resourceKey,
|
||||
'attributes' => $data,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Serialize a collection.
|
||||
*/
|
||||
|
@ -33,6 +22,17 @@ class PterodactylSerializer extends ArraySerializer
|
|||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Serialize an item.
|
||||
*/
|
||||
public function item(?string $resourceKey, array $data): array
|
||||
{
|
||||
return [
|
||||
'object' => $resourceKey,
|
||||
'attributes' => $data,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Serialize a null resource.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue