how to check if validator has errors or not laravel code example
Example: valdidate laravel if falid
$validator = Validator::make($request->all(), [
'name' => 'required|min:2|max:255'
]);
if ($validator->fails()) {
return view('view_name');
} else {
return view('view_name');
}