Controllerui
use Validator;it
public function Validators(){io
$rules = [function
'title' => 'required|max:255',require
'content' => 'required|max:255',foreach
'field' => 'required|max:255',request
];error
$messages = [di
'title.required' => 'Error Message',require
'content.required => 'Content Error Message ',
'field.required' => 'Field Error Message',
];
$validator = Validator::make($request -> all(), $rules , $messages);
if($validator -> fails()){
return redirect('/path') -> withErrors($validator) -> withInput();
}
Blade Templement
@if($errors -> any())
@foreach($errrors -> all() as $error)
{{ $error }}
@endforeach
@endif