public function verify($data, array $callbacks = [], $cast = '')
    {

        if (empty($callbacks) === true) {
            return $this->fields[$cast] = $data;
        }

        // Create a Closure
        $isValid = function ($data) use ($callbacks, $cast) {

            if (empty($cast) === false) {
                $this->cast = $cast;
            }

            foreach ($callbacks as $callback) {
                $this->{$callback}($data);
            }
        };

        // return boolean as such
        return $isValid($data);
    }
public function verify($data, array $callbacks = [], $cast = '')
    {

        if (empty($callbacks) === true) {
            return $this->fields[$cast] = $data;
        }

        // Create a Closure
        $isValid = function ($data) use ($callbacks, $cast) {

            if (empty($cast) === false) {
                $this->cast = $cast;
            }

            foreach ($callbacks as $callback) {
                $this->{$callback}($data);
            }
        };

        // return boolean as such
        return $isValid($data);
    }
public function verify ( $ data , array $ callbacks = [ ] , $ cast = '' ) { if ( empty ( $ callbacks ) === true ) { return $ this -> fields [ $ cast ] = $ data ; } // Create a Closure $ isValid = function ( $ data ) use ( $ callbacks , $ cast ) { if ( empty ( $ cast ) === false ) { $ this -> cast = $ cast ; } foreach ( $ callbacks as $ callback ) { $ this -> { $ callback } ( $ data ) ; } } ; // return boolean as such return $ isValid ( $ data ) ; }
Verify transferred according to the rules

@param  mixed  $data
@param  array  $callbacks
@param  string $cast
@return mixed
Verify transferred according to the rules