protected function mapRules($rules) : Collection
	{
		return Collection::make($rules)
			->only($this->allowed)
			->flatMap(function ($item, $key) {
				if ($key == 'required') {
					$rule[] = $item ? 'required' : '';
				} else {
					$rule[] = $key . ':' . $item;
				}
				return $rule;
			});
	}
protected function mapRules($rules) : Collection
	{
		return Collection::make($rules)
			->only($this->allowed)
			->flatMap(function ($item, $key) {
				if ($key == 'required') {
					$rule[] = $item ? 'required' : '';
				} else {
					$rule[] = $key . ':' . $item;
				}
				return $rule;
			});
	}
protected function mapRules ( $ rules ) : Collection { return Collection :: make ( $ rules ) -> only ( $ this -> allowed ) -> flatMap ( function ( $ item , $ key ) { if ( $ key == 'required' ) { $ rule [ ] = $ item ? 'required' : '' ; } else { $ rule [ ] = $ key . ':' . $ item ; } return $ rule ; } ) ; }
Returns a collection with the given rules.

@param  array $rules

@return Collection
Returns a collection with the given rules .