📌  相关文章
📜  自定义规则 laravel 验证 - PHP 代码示例

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

代码示例1
public function store()
{
    $this->validate(request(), [
        'song' => [function ($attribute, $value, $fail) {
            if ($value <= 10) {
                $fail(':attribute needs more cowbell!');
            }
        }]
    ]);
}