Created
June 7, 2018 01:17
-
-
Save rfmeier/8bcde34ffc1acfbdeaca5c435f3ec426 to your computer and use it in GitHub Desktop.
Throw a validation exception from a controller.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Throw a ValidationException from within a Controller. | |
*/ | |
use Illuminate\Validation\ValidationException; | |
throw ValidationException::withMessages([ | |
'form_item_name' => ['Form item error message.'], | |
]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment