Skip to content

Instantly share code, notes, and snippets.

@allaniftrue
Created May 14, 2021 19:19
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 allaniftrue/94869006b29a6569923d9c2e37376005 to your computer and use it in GitHub Desktop.
Save allaniftrue/94869006b29a6569923d9c2e37376005 to your computer and use it in GitHub Desktop.
Laravel Throw custom 422 error message
<?php
use Illuminate\Validation\ValidationException;
throw ValidationException::withMessages(['field_name' => 'This value is incorrect']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment