try { MFUser::create(array( 'user_reference' => $this->userReference, 'first_name' => $this->firstName, 'last_name' => $this->lastName, 'user_type_id' => $this->userTypeId, 'email' => $this->email, 'password' => $this->password )); } catch (\Illuminate\Database\QueryException $exception) { // You can check get the details of the error using `errorInfo`: $errorInfo = $exception->errorInfo; // Return the response to the client.. }