public function boot()
 {
     $this->app['validator']->extend('currency_code', function ($attribute, $value, $parameters) {
         $currency = new CurrencyService();
         return $currency->checkCurrency($value);
     }, 'Invalid currency code');
 }
Beispiel #2
0
 public function extendValidators()
 {
     // Function to call the Uuid validator
     Validator::extend('currency_code', function ($attribute, $value) {
         $currency = new CurrencyService();
         return $currency->checkCurrency($value);
     }, 'Currency code is incorrect');
 }