Garden\Schema::addValidator PHP Méthode

addValidator() public méthode

Add a custom validator to to validate the schema.
public addValidator ( string $fieldname, callable $callback ) : Schema
$fieldname string The name of the field to validate, if any.
$callback callable The callback to validate with.
Résultat Schema Returns `$this` for fluent calls.
    public function addValidator($fieldname, callable $callback)
    {
        $this->validators[$fieldname][] = $callback;
        return $this;
    }