app['validator']->extend('multidate_format', function ($attribute, $value, $parameters) { if(is_string($value)) { $value = explode(',', $value); } $input = array(); $tests = array(); foreach ($value as $v) { $input[$attribute] = $v; if(count($parameters)) { $tests[$attribute] = 'date_format:'.$parameters[0]; } $validator = Validator::make($input, $tests); if($validator->fails()) { return false; } } return true; }); } public function register() { // } }