"required|min:2|max:255", "surname" => "required|min:2|max:255", "mobile_number_country" => "required_with:mobile_number|string|size:2", "mobile_number" => "phone:mobile_number_country|exists:users,mobile_number", "profile_link" => "string|min:5|max:15|unique:user_profiles,profile_link,". auth()->user()->userProfile->id, "short_bio" => "max:100", ]; } public function getValidatorInstance() { if($this->request->has("mobile_number") && $this->request->has("mobile_number_country")) { $this->request->set("mobile_number", PhoneNumber::make( $this->request->get("mobile_number"), $this->request->get("mobile_number_country") )->formatInternational()); } return parent::getValidatorInstance(); } }