Files

24 lines
665 B
PHP
Raw Permalink Normal View History

<?php
namespace App\Http\Resources;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
class TaskCommentResource extends JsonResource
{
public function toArray(Request $request): array
{
return [
'id' => $this->id,
'body' => $this->body,
'author_type' => $this->author_type,
'author_name' => $this->author_name,
'task_id' => $this->task_id,
'created_at' => $this->created_at->toIso8601String(),
'updated_at' => $this->updated_at->toIso8601String(),
'deleted_at' => $this->deleted_at?->toIso8601String(),
];
}
}