invitation page implementation

This commit is contained in:
Čarodej
2021-10-25 17:14:27 +02:00
parent b45662942d
commit 524791f251
21 changed files with 616 additions and 57 deletions
@@ -1,4 +1,5 @@
<?php
namespace Domain\Teams\Resources;
use Illuminate\Http\Resources\Json\JsonResource;
@@ -9,14 +10,30 @@ class TeamInvitationResource extends JsonResource
{
return [
'data' => [
'id' => $this->id,
'type' => 'invitation',
'attributes' => [
'id' => $this->id,
'type' => 'invitation',
'attributes' => [
'parent_id' => $this->parent_id,
'email' => $this->email,
'color' => $this->color,
'status' => $this->status,
'permission' => $this->permission,
],
'relationships' => [
$this->mergeWhen($this->inviter, fn() => [
'inviter' => [
'data' => [
'type' => 'user',
'id' => $this->inviter->id,
'attributes' => [
'name' => $this->inviter->settings->name,
'avatar' => $this->inviter->settings->avatar,
'color' => $this->inviter->settings->color,
],
],
],
]),
],
],
];
}