Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

AsnCode's avatar

validation.required instead of the title is required .... livewire

Hello i have a livewire app and i dont know why but i have this error :

validation.required

instead of title is required ... or title is minimum 3 characters something like that

My code

and my blade view

<form wire:submit.prevent="store" enctype="multipart/form-data">
		<input wire:model="title" id="title" type="text" autocomplete="title" class="block w-full " />
		
		 @error('title')
               <small class="pl-0.5 text-red-500">{{ $message }}</small>
         @enderror
 
<button type="submit" class="rounded-md bg-indigo-600">Save</button>
</form>

I dont know why livewire dont show my error properly !?

thanks you.

0 likes
6 replies
AudreyTeles's avatar

You can try adding this line below your input:

<div>@error('title') {{ $message }} @enderror</div>

This will specify the field where the message should appear.


The Livewire documentation suggests using Forms, which might be a good approach for you too.

Source: https://livewire.laravel.com/docs/validation

AsnCode's avatar

@AudreyTeles yes @error ... @enderror is already in my code . If i debug $errors in my view i have this:

{"title":["validation.required"],"description":["validation.required"],"price":["validation.required"],"category":["validation.required"],"status":["validation.required"],"photos":["validation.required"]}
jj15's avatar
jj15
Best Answer
Level 10

@AsnCode

Your code looks fine to me. I did some searching and it seems like it may be due to the locale and fallback_locale set in config/app.php being incorrect. Make sure they're set both to en, which is the default.

If you've added your own locale, then you'll need to copy and create your own, translated versions of the messages used by Laravel.

You may also want to run composer dump-autoload and php artisan optimize:clear to clear out any stale caches.

Also - with Livewire v3, you don't need to add the .prevent modifier to wire:submit, it's done for you.

1 like
AsnCode's avatar

@jj15 Nice ... I was make a mistake i added FR_fr local in a library but not updated my fallback in .env. Thanks you !

Please or to participate in this conversation.