src/Models/Base.php
/**
     * Validates the Model
     * @param  Model   $model The Model to check
     * @return boolean        Whether or not the input is valid
     */
Validates the Model
@param  Model   $model The Model to check
@return boolean        Whether or not the input is valid
Validates the Model @param Model $model The Model to check @return boolean Whether or not the input is valid
public function validate(Model $model){
        $validator = Validator::make($model->toArray(), $model->getValidationRules(), $model->getValidationMessages());
        if($validator->fails()){
            throw new ValidationException($validator->errors()->first());
        } else {
            return true;
        }
    }
public function validate ( Model $ model ) { $ validator = Validator :: make ( $ model -> toArray ( ) , $ model -> getValidationRules ( ) , $ model -> getValidationMessages ( ) ) ; if ( $ validator -> fails ( ) ) { throw new ValidationException ( $ validator -> errors ( ) -> first ( ) ) ; } else { return true ; } }
Validates the Model
 @param  Model   $model The Model to check
 @return boolean        Whether or not the input is valid
Validates the Model @param Model $model The Model to check @return boolean Whether or not the input is valid