add guest invitation read & valide with route
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Http\Resources;
|
||||
|
||||
use App\Http\Resources\User as UserResource;
|
||||
use App\Http\Resources\EventGuestWithoutEmail as GuestsWithoutEmailResource;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class Event extends JsonResource
|
||||
@@ -32,6 +33,9 @@ class Event extends JsonResource
|
||||
],
|
||||
],
|
||||
'invitations' => UserResource::collection($this->guests),
|
||||
'invitations-with-email' => [
|
||||
'data' => GuestsWithoutEmailResource::collection($this->emailedGuests)
|
||||
],
|
||||
]
|
||||
],
|
||||
],
|
||||
|
||||
23
app/Http/Resources/EventGuestWithoutEmail.php
Normal file
23
app/Http/Resources/EventGuestWithoutEmail.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class EventGuestWithoutEmail extends JsonResource
|
||||
{
|
||||
/**
|
||||
* Transform the resource into an array.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return array
|
||||
*/
|
||||
public function toArray($request)
|
||||
{
|
||||
return [
|
||||
'email' => $this->email,
|
||||
'read_at' => $this->read_at,
|
||||
'validated_at' => $this->validated_at,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user