public function validate($operation, $model)
    {
        $model = is_array($model) ? $model : $model->getAttributes();

        $rules = $this->model->rules($operation == 'update' ? array_keys($model) : null, $operation);

        $rules = $this->interpolateValidationRules($rules, $model);

        $validator = Validator::make($model, $rules);

        $messages = [];

        if ($validator->fails()) {
            $messages = $validator->messages()->all();
        }

        // Perform other validations
        foreach ($this->validations as $validationMethod) {
            if ($message = $this->{$validationMethod}($model)) {
                $messages[] = $message;
            }
        }

        if (count($messages)) {
            throw App::make('sedp-mis.base-repository.validationException', $messages);
        }
    }