src/Traits/Module/ValidatesForm.php
protected function scaffoldRules()
    {
        $rules = [];

        $eloquent = $this->model();
        $table = $eloquent->getTable();

        foreach (scheme()->columns($table) as $column) {
            $name = $column->getName();
            // skip Primary Key
            if ($name === $eloquent->getKeyName()) {
                continue;
            }

            // skip rankable field
            if ($eloquent instanceof Rankable && $name === $eloquent->getRankableColumn()) {
                continue;
            }

            if (!empty($columnRules = $this->proposeColumnRules($eloquent, $column))) {
                $rules[$name] = implode('|', $columnRules);
            }
        }

        return $rules;
    }
protected function scaffoldRules()
    {
        $rules = [];

        $eloquent = $this->model();
        $table = $eloquent->getTable();

        foreach (scheme()->columns($table) as $column) {
            $name = $column->getName();
            // skip Primary Key
            if ($name === $eloquent->getKeyName()) {
                continue;
            }

            // skip rankable field
            if ($eloquent instanceof Rankable && $name === $eloquent->getRankableColumn()) {
                continue;
            }

            if (!empty($columnRules = $this->proposeColumnRules($eloquent, $column))) {
                $rules[$name] = implode('|', $columnRules);
            }
        }

        return $rules;
    }
protected function scaffoldRules ( ) { $ rules = [ ] ; $ eloquent = $ this -> model ( ) ; $ table = $ eloquent -> getTable ( ) ; foreach ( scheme ( ) -> columns ( $ table ) as $ column ) { $ name = $ column -> getName ( ) ; // skip Primary Key if ( $ name === $ eloquent -> getKeyName ( ) ) { continue ; } // skip rankable field if ( $ eloquent instanceof Rankable && $ name === $ eloquent -> getRankableColumn ( ) ) { continue ; } if ( ! empty ( $ columnRules = $ this -> proposeColumnRules ( $ eloquent , $ column ) ) ) { $ rules [ $ name ] = implode ( '|' , $ columnRules ) ; } } return $ rules ; }
Build a list of supposed validators based on columns and indexes information.

@return array
Build a list of supposed validators based on columns and indexes information .