|
|
@@ -10,27 +10,21 @@
|
|
|
|
|
|
class SupportTicketResource extends JsonResource
|
|
|
{
|
|
|
- /**
|
|
|
- * Transform the resource into an array.
|
|
|
- *
|
|
|
- * @return array<string, mixed>
|
|
|
- */
|
|
|
public function toArray(Request $request): array
|
|
|
{
|
|
|
return [
|
|
|
- 'id' => $this->id,
|
|
|
- 'name' => $this->name,
|
|
|
- 'created_at' => Carbon::parse($this->created_at)->format('Y-m-d H:i:s'),
|
|
|
- 'updated_at' => Carbon::parse($this->updated_at)->format('Y-m-d H:i:s'),
|
|
|
- // Add your fields here
|
|
|
-
|
|
|
- // Conditional fields
|
|
|
- // $this->mergeWhen($request->user()?->isAdmin(), [
|
|
|
- // 'internal_notes' => $this->internal_notes,
|
|
|
- // ]),
|
|
|
-
|
|
|
- // Relationships
|
|
|
- // 'user' => new UserResource($this->whenLoaded('user')),
|
|
|
+ 'id' => $this->id,
|
|
|
+ 'title' => $this->title,
|
|
|
+ 'description' => $this->description,
|
|
|
+ 'severity' => $this->severity,
|
|
|
+ 'scope' => $this->scope,
|
|
|
+ 'unit_id' => $this->unit_id,
|
|
|
+ 'sector' => $this->sector,
|
|
|
+ 'support_status_id' => $this->support_status_id,
|
|
|
+ 'applicant_user_id' => $this->applicant_user_id,
|
|
|
+ 'responsable_user_id' => $this->responsable_user_id,
|
|
|
+ 'created_at' => Carbon::parse($this->created_at)->format('d/m/Y H:i'),
|
|
|
+ 'updated_at' => Carbon::parse($this->updated_at)->format('d/m/Y H:i'),
|
|
|
];
|
|
|
}
|
|
|
|