Skip to content

Instantly share code, notes, and snippets.

@rfmeier
Created June 7, 2018 01:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rfmeier/8bcde34ffc1acfbdeaca5c435f3ec426 to your computer and use it in GitHub Desktop.
Save rfmeier/8bcde34ffc1acfbdeaca5c435f3ec426 to your computer and use it in GitHub Desktop.
Throw a validation exception from a controller.
<?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