Throw Exception, Validation and Error Handling |
Struggling here. I have a form with validation. I have a custom rule with a callback method. In the callback method, I have a try/catch exception on a google lib that has a good number of custom validation messages eg, not a valid phone number, phone number too long, etc). How can I validate the form and also get back the custom message
PHP Code: // validates the phone number. takes a phone number and a country code. in the teleNumberValidation i want to do something like this; Code: try { but validation only accepts true or false so how can I get $e->getMessage() into something like this; Code: return redirect()->back() |
Messages In This Thread |
Throw Exception, Validation and Error Handling - by spreaderman - 04-04-2022, 09:13 PM
RE: Throw Exception, Validation and Error Handling - by kenjis - 04-04-2022, 10:16 PM
RE: Throw Exception, Validation and Error Handling - by spreaderman - 04-05-2022, 03:22 PM
RE: Throw Exception, Validation and Error Handling - by kenjis - 04-05-2022, 04:43 PM
RE: Throw Exception, Validation and Error Handling - by spreaderman - 04-05-2022, 05:37 PM
RE: Throw Exception, Validation and Error Handling - by kenjis - 04-05-2022, 05:57 PM
RE: Throw Exception, Validation and Error Handling - by spreaderman - 04-07-2022, 05:35 AM
|