2017-01-30 20:40:43 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Ninja\Transformers;
|
2016-01-24 19:55:36 +01:00
|
|
|
|
|
|
|
use App\Models\Invitation;
|
|
|
|
|
|
|
|
class InvitationTransformer extends EntityTransformer
|
|
|
|
{
|
|
|
|
public function transform(Invitation $invitation)
|
|
|
|
{
|
2016-07-19 09:07:56 +02:00
|
|
|
$invitation->setRelation('account', $this->account);
|
|
|
|
|
2016-01-24 19:55:36 +01:00
|
|
|
return [
|
|
|
|
'id' => (int) $invitation->public_id,
|
|
|
|
'key' => $invitation->getName(),
|
|
|
|
'link' => $invitation->getLink(),
|
2018-06-26 13:48:32 +02:00
|
|
|
'sent_date' => $invitation->sent_date ?: '',
|
|
|
|
'viewed_date' => $invitation->sent_date ?: '',
|
2016-01-24 19:55:36 +01:00
|
|
|
];
|
|
|
|
}
|
2016-07-19 09:07:56 +02:00
|
|
|
}
|