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.. }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter