added "members" for an event that help the admins to moderate. members must be invited via email.
This commit is contained in:
32
app/Http/Resources/Tenant/EventMemberResource.php
Normal file
32
app/Http/Resources/Tenant/EventMemberResource.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources\Tenant;
|
||||
|
||||
use App\Models\EventMember;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
/** @mixin EventMember */
|
||||
class EventMemberResource extends JsonResource
|
||||
{
|
||||
/**
|
||||
* Transform the resource into an array.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'name' => $this->name ?? $this->user?->full_name ?? $this->email,
|
||||
'email' => $this->email,
|
||||
'role' => $this->role,
|
||||
'status' => $this->status,
|
||||
'joined_at' => $this->joined_at,
|
||||
'invited_at' => $this->invited_at,
|
||||
'avatar_url' => $this->user?->profile_photo_url ?? null,
|
||||
'permissions' => $this->permissions,
|
||||
'user_id' => $this->user_id,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user