31 خطوط
1.0 KiB
PHP
31 خطوط
1.0 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class BacklogItemResource extends JsonResource
|
|
{
|
|
public function toArray(Request $request): array
|
|
{
|
|
return [
|
|
'id' => $this->id,
|
|
'title' => $this->title,
|
|
'description' => $this->description,
|
|
'type' => $this->type,
|
|
'project_id' => $this->project_id,
|
|
'project' => new ProjectResource($this->whenLoaded('project')),
|
|
'priority' => $this->priority,
|
|
'estimated_effort' => $this->estimated_effort,
|
|
'status' => $this->status,
|
|
'assigned_sprint_id' => $this->assigned_sprint_id,
|
|
'assigned_sprint' => new SprintResource($this->whenLoaded('assignedSprint')),
|
|
'created_by' => $this->created_by,
|
|
'creator' => new UserResource($this->whenLoaded('creator')),
|
|
'created_at' => $this->created_at,
|
|
'updated_at' => $this->updated_at,
|
|
];
|
|
}
|
|
}
|