Add notification action foundation
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class NotificationDeliveryLogResource extends JsonResource
|
||||
{
|
||||
/**
|
||||
* Transform the resource into an array.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'notification_action_id' => $this->notification_action_id,
|
||||
'event_type' => $this->event_type->value,
|
||||
'event_type_label' => $this->event_type->label(),
|
||||
'channel' => $this->channel->value,
|
||||
'channel_label' => $this->channel->label(),
|
||||
'delivery_status' => $this->delivery_status->value,
|
||||
'delivery_status_label' => $this->delivery_status->label(),
|
||||
'attempt_count' => $this->attempt_count,
|
||||
'http_status' => $this->http_status,
|
||||
'response_excerpt' => $this->response_excerpt,
|
||||
'error_excerpt' => $this->error_excerpt,
|
||||
'payload_metadata' => $this->payload_metadata,
|
||||
'last_attempted_at' => $this->last_attempted_at?->toISOString(),
|
||||
'delivered_at' => $this->delivered_at?->toISOString(),
|
||||
'created_at' => $this->created_at?->toISOString(),
|
||||
'updated_at' => $this->updated_at?->toISOString(),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user