31 lines
894 B
PHP
31 lines
894 B
PHP
<?php
|
|
|
|
namespace App\Http\Resources\Tenant;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
/** @mixin \App\Models\GuestNotification */
|
|
class GuestNotificationResource extends JsonResource
|
|
{
|
|
/**
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function toArray(Request $request): array
|
|
{
|
|
return [
|
|
'id' => $this->id,
|
|
'type' => $this->type->value,
|
|
'title' => $this->title,
|
|
'body' => $this->body,
|
|
'status' => $this->status->value,
|
|
'audience_scope' => $this->audience_scope->value,
|
|
'target_identifier' => $this->target_identifier,
|
|
'payload' => $this->payload,
|
|
'priority' => $this->priority,
|
|
'expires_at' => $this->expires_at?->toISOString(),
|
|
'created_at' => $this->created_at?->toISOString(),
|
|
];
|
|
}
|
|
}
|