first&last
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class ServiceRequestResource extends JsonResource
|
||||
{
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'ticket_number' => $this->ticket_number,
|
||||
'title' => $this->title,
|
||||
'description' => $this->description,
|
||||
'type' => $this->type?->name,
|
||||
'priority' => $this->priority?->name,
|
||||
'priority_color' => $this->priority?->color_hex,
|
||||
'status' => $this->status?->name,
|
||||
'status_slug' => $this->status?->slug,
|
||||
'status_color' => $this->status?->color_hex,
|
||||
'client' => $this->client?->name,
|
||||
'assignee' => $this->assignee?->name,
|
||||
'deadline_at' => $this->deadline_at?->toDateTimeString(),
|
||||
'created_at' => $this->created_at?->toDateTimeString(),
|
||||
'updated_at' => $this->updated_at?->toDateTimeString(),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user