app/Providers/ValidatorServiceProvider.php
/**
     * Bootstrap any application services.
     *
     * @return void
     */
Bootstrap any application services.
@return void
Bootstrap any application services . @return void
public function boot()
    {
        Validator::extend('files_count', function ($attribute, $value, $parameters, $validator) {
            $maxCount = $parameters[0];
            return count($value) <= $maxCount;
        });
        Validator::replacer('files_count', function($message, $attribute, $rule, $parameters){
            return str_replace(':max_count', $parameters[0], $message);
        });
    }
public function boot ( ) { Validator :: extend ( 'files_count' , function ( $ attribute , $ value , $ parameters , $ validator ) { $ maxCount = $ parameters [ 0 ] ; return count ( $ value ) <= $ maxCount ; } ) ; Validator :: replacer ( 'files_count' , function ( $ message , $ attribute , $ rule , $ parameters ) { return str_replace ( ':max_count' , $ parameters [ 0 ] , $ message ) ; } ) ; }
Bootstrap any application services.
Bootstrap any application services .