php - How can I manually return or throw a validation error/exception in Laravel? - Stack Overflow

PHOTO EMBED

Thu Jun 30 2022 16:44:57 GMT+0000 (UTC)

Saved by @WMOH #php

use Illuminate\Validation\ValidationException;

throw ValidationException::withMessages(['field_name' => 'This value is incorrect']);
content_copyCOPY

https://stackoverflow.com/questions/47219542/how-can-i-manually-return-or-throw-a-validation-error-exception-in-laravel