mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-10 00:34:50 +00:00
Add DirectMessageTransformer
This commit is contained in:
parent
f47cd88438
commit
3e5af1b98a
1 changed files with 23 additions and 0 deletions
23
app/Transformer/Api/DirectMessageTransformer.php
Normal file
23
app/Transformer/Api/DirectMessageTransformer.php
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Transformer\Api;
|
||||||
|
|
||||||
|
use League\Fractal;
|
||||||
|
use App\DirectMessage;
|
||||||
|
|
||||||
|
class DirectMessageTransformer extends Fractal\TransformerAbstract
|
||||||
|
{
|
||||||
|
public function transform(DirectMessage $dm)
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'id' => $dm->id,
|
||||||
|
'to_id' => $dm->to_id,
|
||||||
|
'from_id' => $dm->from_id,
|
||||||
|
'from_profile_ids' => $dm->from_profile_ids,
|
||||||
|
'group_message' => $dm->group_message,
|
||||||
|
'status_id' => $dm->status_id,
|
||||||
|
'read_at' => $dm->read_at,
|
||||||
|
'created_at' => $dm->created_at
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue