$this->id, 'title' => $this->title, 'description' => $this->description, 'severity' => $this->severity, 'scope' => $this->scope, 'sector' => $this->sector, 'status' => $this->status, 'origin' => $this->origin, 'applicant_user_id' => $this->applicant_user_id, 'responsable_user_id' => $this->responsable_user_id, 'applicant_unit_id' => $this->applicant_unit_id, 'target_unit_id' => $this->target_unit_id, 'applicant_unit_name' => $this->whenLoaded('applicantUnit', fn() => $this->applicantUnit?->fantasy_name), 'target_unit_name' => $this->whenLoaded('targetUnit', fn() => $this->targetUnit?->fantasy_name), 'batch_id' => $this->batch_id, 'created_at' => $this->created_at?->format('d/m/Y H:i'), 'updated_at' => $this->updated_at?->format('d/m/Y H:i'), ]; } /** * @param \Illuminate\Database\Eloquent\Collection $resource * @return \Illuminate\Http\Resources\Json\AnonymousResourceCollection */ public static function collection($resource): AnonymousResourceCollection { return parent::collection($resource); } }