| 1234567891011121314151617181920212223 |
- <?php
- namespace App\Http\Resources;
- use Illuminate\Http\Request;
- use Illuminate\Http\Resources\Json\JsonResource;
- class PartnerAgreementEnderecoResource extends JsonResource
- {
- public function toArray(Request $request): array
- {
- return [
- 'id' => $this->id,
- 'zip_code' => $this->zip_code,
- 'address' => $this->address,
- 'neighborhood' => $this->neighborhood,
- 'city_id' => $this->city_id,
- 'city' => $this->whenLoaded('city', fn() => new CityResource($this->city)),
- 'state_id' => $this->state_id,
- 'state' => $this->whenLoaded('state', fn() => new StateResource($this->state)),
- ];
- }
- }
|