📜  valdidate laravel if falid - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:46.529000             🧑  作者: Mango

代码示例2
$validator = Validator::make($request->all(), [
    'name' => 'required|min:2|max:255'
]);

if ($validator->fails()) {
    return view('view_name');
} else {
    return view('view_name');
}