Is there a simple way to use the @error Laravel Blade directive conditionally for several fields? For example, if field1 or field2 contains validation errors, I was wondering if there is some way to use the directive like that (note that the following example is not valid):
@error('field1' || 'field2')
...
@enderror
Docs say that "we may pass the name of a specific error bag as the second parameter to the @error directive to retrieve validation error messages on pages containing multiple forms", but nothing about this feature.
Finally, if you consider it is not worthy, what would be the Laravel way of implementing such condition?
Thanks in advance.
source https://stackoverflow.com/questions/70128257/error-laravel-directive-for-several-fields
Comments
Post a Comment