App\Transformers\API\Chat\PrivateMessageTransformer::transform PHP Method

transform() public method

public transform ( PrivateMessage $message )
$message App\Models\Chat\PrivateMessage
    public function transform(PrivateMessage $message)
    {
        return ['message_id' => $message->message_id, 'user_id' => $message->user_id, 'target_id' => $message->target_id, 'timestamp' => $message->timestamp->toDateTimeString(), 'content' => $message->content, 'sender' => ['username' => $message->sender->username, 'colour' => $message->sender->user_colour]];
    }
PrivateMessageTransformer