结帐产品增值税验证扩展服务提供商'没有找到


checkout a product VAT ValidationExtensionS Service Provider' not found

我在结帐产品增值税验证时面临自定义验证的问题。

但是我正在运行这个错误:

类"App'Providers'ValidationExtensionS Service Provider"未找到。

有谁能帮我解决这个问题吗?

我把valadatoreextend。php文件附在这里

namespace App'Services;
use App'Services'ValidatorExtended;
use Illuminate'Support'ServiceProvider;
use Illuminate'Validation'Validator as IlluminateValidator;
class ValidatorExtended extends IlluminateValidator {
private $_custom_messages = array(
   "vat" => "The :attribute is not a valid VAT.",
   //place for more customized messages
);
public function __construct( $translator, $data, $rules, $messages = array(), $customAttributes = array() ) {
parent::__construct( $translator, $data, $rules, $messages, $customAttributes );
 $this->_set_custom_stuff();
}
protected function _set_custom_stuff() {
   //setup our custom error messages
   $this->setCustomMessages( $this->_custom_messages );
}
protected function validateVat( $attribute, $value ) {
   // You can extend your RegEx with other Countries, if you like
   return (bool) preg_match( "/((DK|FI|HU|LU|MT|SI)(-)?'d{8})|((BE|EE|DE|EL|LT|PT)(-)?'d{9})|((PL|SK)(-)?'d{10})|((IT|LV)(-)?'d{11})|((LT|SE)(-)?'d{12})|(AT(-)?U'd{8})|(CY(-)?'d{8}[A-Z])|(CZ(-)?'d{8,10})|(FR(-)?['dA-HJ-NP-Z]{2}'d{9})|(IE(-)?'d[A-Z'd]'d{5}[A-Z])|(NL(-)?'d{9}B'd{2})|(ES(-)?[A-Z'd]'d{7}[A-Z'd])/", $value );
  }
   //place for more protected functions for other custom validations
  }

看起来你在某个地方搞砸了你的Use语句。如果您尝试使用ValidatorExtended类,您的use语句应该看起来像:

use App'Services'ValidatorExtended;

看它,你提供的代码似乎不适合给出的错误。