Files
Investidor-V2/app/Http/Resources/PublicBusinessOpportunityResource.php
T
nala 4f35313d06
tests / ci (push) Canceled after 0s
novas funcionalidades dos formulario
2026-10-02 11:13:37 +02:00

32 lines
1.0 KiB
PHP

<?php
namespace App\Http\Resources;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
class PublicBusinessOpportunityResource extends JsonResource
{
/** @return array<string, mixed> */
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,
];
}
}