I want to customize error message with removing bullet. I'm beginner in Laravel,I don't know how can I do that. I tried changing the message in resources/lang/en/validation.php but It didn't change exactly as I wanted. Then I've tried with this code but haven't changed anything. How can I do that?
My controller is:
protected function validator(array $data)
{
$messages = [
'email.required' => 'test',
];
return Validator::make($data, [
'name' => ['required', 'string', 'max:255'],
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
'password' => ['required', 'string', 'min:8', 'confirmed'],$messages
]);
}
/**
* @param array $data
* @return \App\Models\User
*/
protected function create(array $data)
{
return User::create([
'name' => $data['name'],
'email' => $data['email'],
'password' => Hash::make($data['password']),
]);
}
My blade is:
@if ($errors->any())
<div class="alert alert-danger">
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif