Example #1
0
 /**
  * Serializes the validation errors in a model.
  * @param Model $model
  * @return array the array representation of the errors
  */
 protected function serializeModelErrors($model)
 {
     $this->response->setStatusCode(422, 'Data Validation Failed.');
     return $this->firstErrors ? $model->getFirstErrors() : $model->getErrors();
 }