📜  laravel 验证存在多个表 laravel - TypeScript 代码示例

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

代码示例1
$validator = Validator::make($request->all(), [
    'title' => [
        'required',
        'max:255',
        function($attribute, $value, $fail) {
            if ($value === 'foo') {
                return $fail($attribute.' is invalid.');
            }
        },
    ],
]);