@@ -11,21 +11,21 @@ class PublicBusinessOpportunityResource extends JsonResource
|
||||
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,
|
||||
'id' => data_get($this->resource, 'id'),
|
||||
'slug' => data_get($this->resource, 'public_slug'),
|
||||
'title' => data_get($this->resource, 'public_title'),
|
||||
'activity_code' => data_get($this->resource, 'activity_code'),
|
||||
'stage' => data_get($this->resource, 'stage'),
|
||||
'objective' => data_get($this->resource, 'objective'),
|
||||
'currency' => data_get($this->resource, 'currency'),
|
||||
'amount_min' => data_get($this->resource, 'amount_min'),
|
||||
'amount_max' => data_get($this->resource, 'amount_max'),
|
||||
'available_percentage' => data_get($this->resource, 'available_percentage'),
|
||||
'published_at' => data_get($this->resource, 'published_at'),
|
||||
'sector' => $this->whenLoaded('sector', fn () => data_get($this->resource, 'sector')?->only(['name', 'slug'])),
|
||||
'province' => $this->resource->getAttribute('province'),
|
||||
'district' => $this->resource->getAttribute('district'),
|
||||
'locality' => $this->resource->getAttribute('locality'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user