*/ public function toArray(Request $request): array { return [ 'id' => $this->id, 'slug' => $this->public_slug, 'title' => $this->public_title, 'activity_code' => $this->activity_code, 'stage' => $this->stage, 'objective' => $this->objective, 'currency' => $this->currency, 'amount_min' => $this->amount_min, 'amount_max' => $this->amount_max, 'available_percentage' => $this->available_percentage, 'published_at' => $this->published_at, 'sector' => $this->whenLoaded('sector', fn () => $this->sector?->only(['name', 'slug'])), 'province' => $this->province, 'district' => $this->district, 'locality' => $this->locality, ]; } }