mandant-crm/backend/app/Modules/History/Resources/HistoryEntryResource.php

26 lines
751 B
PHP
Raw Normal View History

<?php
namespace App\Modules\History\Resources;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
class HistoryEntryResource extends JsonResource
{
public function toArray(Request $request): array
{
return [
'id' => $this->id,
'client_id' => $this->client_id,
'type' => $this->type->value,
'body' => $this->body,
'author_id' => $this->author_id,
'author_name' => $this->author?->name,
'updated_by' => $this->updated_by,
'updated_by_name' => $this->updatedBy?->name,
'created_at' => $this->created_at->toISOString(),
'updated_at' => $this->updated_at->toISOString(),
];
}
}