29 lines
806 B
PHP
29 lines
806 B
PHP
<?php
|
|
|
|
namespace App\Http\Resources\Intervention;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class InterventionNotificationResource extends JsonResource
|
|
{
|
|
/**
|
|
* Transform the resource into an array.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function toArray(Request $request): array
|
|
{
|
|
return [
|
|
'id' => $this->id,
|
|
'intervention_id' => $this->intervention_id,
|
|
'channel' => $this->channel,
|
|
'destination' => $this->destination,
|
|
'payload' => $this->payload,
|
|
'status' => $this->status,
|
|
'sent_at' => $this->sent_at ? $this->sent_at->format('Y-m-d H:i:s') : null,
|
|
'created_at' => $this->created_at->format('Y-m-d H:i:s')
|
|
];
|
|
}
|
|
}
|