protected function createRules($field, $rules)
    {
        $rule = str_replace(['(', ')', ';'], [':', '', ','], implode('|', $rules));

        if ($this->scaffold) {
            $rule = 'required';
        }

        return "\t\t\t'{$field}' => '".$rule."',".PHP_EOL;
    }
protected function createRules($field, $rules)
    {
        $rule = str_replace(['(', ')', ';'], [':', '', ','], implode('|', $rules));

        if ($this->scaffold) {
            $rule = 'required';
        }

        return "\t\t\t'{$field}' => '".$rule."',".PHP_EOL;
    }
protected function createRules ( $ field , $ rules ) { $ rule = str_replace ( [ '(' , ')' , ';' ] , [ ':' , '' , ',' ] , implode ( '|' , $ rules ) ) ; if ( $ this -> scaffold ) { $ rule = 'required' ; } return "\t\t\t'{$field}' => '" . $ rule . "'," . PHP_EOL ; }
Create a rule.

@param string $field
@param string $rules

@return string
Create a rule .