*/ public function toArray(Request $request): array { return [ 'id' => $this->id, 'name' => $this->name, 'email' => $this->email, 'phone' => $this->phone, 'language' => $this->language, 'type' => $this->type, 'provider_id' => $this->provider?->id, 'provider_daily_price_8h' => $this->provider?->daily_price_8h, 'provider_daily_price_6h' => $this->provider?->daily_price_6h, 'provider_daily_price_4h' => $this->provider?->daily_price_4h, 'provider_daily_price_2h' => $this->provider?->daily_price_2h, 'client_id' => $this->client?->id, 'provider' => $this->whenLoaded('provider'), 'client' => $this->whenLoaded('client'), 'created_at' => Carbon::parse($this->created_at)->format('Y-m-d H:i'), 'updated_at' => Carbon::parse($this->updated_at)->format('Y-m-d H:i'), ]; } public static function collection($resource): AnonymousResourceCollection { return parent::collection($resource); } }