public function rules(): array 	{ 		$rule = [];  		foreach (Address::getTypes() as $type) { 			$request = request();  			$req_rule = 'nullable';  			if ($request->address_name[$type] || $request->country_code[$type] || $request->street[$type] || $request->city[$type] || $request->zip_code[$type] || $request->phone[$type]) { 				$req_rule = 'required'; 			}  			$rule['address_name.' . $type] = [$req_rule, 'string', 'max:150']; 			$rule['country_code.' . $type] = [$req_rule, 'string', Rule::in(Address::getCountries())]; 			$rule['street.' . $type] = [$req_rule, 'string', 'max:150']; 			$rule['city.' . $type] = [$req_rule, 'string', 'max:50']; 			$rule['zip_code.' . $type] = [$req_rule, 'string', 'max:20']; 			$rule['phone.' . $type] = ['nullable', 'string', 'max:20']; 		}  		return $rule; 	}