original_string: protected function registerValidator()
      {
          $this->app->resolving('validator', function($validator) {
              /*
               * Allowed file extensions, as opposed to mime types.
               * - extensions: png,jpg,txt
               */
              $validator->extend('extensions', function ($attribute, $value, $parameters) {
                  $extension = strtolower($value->getClientOriginalExtension());
                  return in_array($extension, $parameters);
              });
  
              $validator->replacer('extensions', function ($message, $attribute, $rule, $parameters) {
                  return strtr($message, [':values' => implode(', ', $parameters)]);
              });
          });
      }
code: protected function registerValidator()
      {
          $this->app->resolving('validator', function($validator) {
              /*
               * Allowed file extensions, as opposed to mime types.
               * - extensions: png,jpg,txt
               */
              $validator->extend('extensions', function ($attribute, $value, $parameters) {
                  $extension = strtolower($value->getClientOriginalExtension());
                  return in_array($extension, $parameters);
              });
  
              $validator->replacer('extensions', function ($message, $attribute, $rule, $parameters) {
                  return strtr($message, [':values' => implode(', ', $parameters)]);
              });
          });
      }
code_tokens: protected function registerValidator ( ) { $ this -> app -> resolving ( 'validator' , function ( $ validator ) { /*
               * Allowed file extensions, as opposed to mime types.
               * - extensions: png,jpg,txt
               */ $ validator -> extend ( 'extensions' , function ( $ attribute , $ value , $ parameters ) { $ extension = strtolower ( $ value -> getClientOriginalExtension ( ) ) ; return in_array ( $ extension , $ parameters ) ; } ) ; $ validator -> replacer ( 'extensions' , function ( $ message , $ attribute , $ rule , $ parameters ) { return strtr ( $ message , [ ':values' => implode ( ', ' , $ parameters ) ] ) ; } ) ; } ) ; }
docstring: Extends the validator with custom rules
docstring_tokens: Extends the validator with custom rules