protected function setValidations($modelData)
    {
        $fields = '';
        $firstIteration = true;

        foreach ($modelData->fields as $field)
        {
            if ($firstIteration)
            {
                $fields .= sprintf("'%s' => '%s'," . PHP_EOL, $field->name, $field->validations);
                $firstIteration = false;
            }
            else
            {
                $fields .= sprintf($this->tab(3) . "'%s' => '%s'," . PHP_EOL, $field->name, $field->validations);
            }
        }

        $this->stub = str_replace('{{validations}}', $fields, $this->stub);

        return $this;
    }
protected function setValidations($modelData)
    {
        $fields = '';
        $firstIteration = true;

        foreach ($modelData->fields as $field)
        {
            if ($firstIteration)
            {
                $fields .= sprintf("'%s' => '%s'," . PHP_EOL, $field->name, $field->validations);
                $firstIteration = false;
            }
            else
            {
                $fields .= sprintf($this->tab(3) . "'%s' => '%s'," . PHP_EOL, $field->name, $field->validations);
            }
        }

        $this->stub = str_replace('{{validations}}', $fields, $this->stub);

        return $this;
    }
protected function setValidations ( $ modelData ) { $ fields = '' ; $ firstIteration = true ; foreach ( $ modelData -> fields as $ field ) { if ( $ firstIteration ) { $ fields .= sprintf ( "'%s' => '%s'," . PHP_EOL , $ field -> name , $ field -> validations ) ; $ firstIteration = false ; } else { $ fields .= sprintf ( $ this -> tab ( 3 ) . "'%s' => '%s'," . PHP_EOL , $ field -> name , $ field -> validations ) ; } } $ this -> stub = str_replace ( '{{validations}}' , $ fields , $ this -> stub ) ; return $ this ; }
Set validations.

@param $modelData

@return $this
Set validations .