laravel 4:验证唯一(数据库)多个 where 子句 [英] laravel 4: validation unique (database) multiple where clauses

查看:18
本文介绍了laravel 4:验证唯一(数据库)多个 where 子句的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

laravel 4 文档提到了独特的字段验证.他们在这里解释了如何将 where 子句包含到唯一验证中.唯一表的单个 WHERE 子句,例如:

The laravel 4 documentation mentions unique field validation. They explain here how to include where clauses to the unique validation. A single WHERE clause for the unique table for example:

$validator = Validator::make(
    array(
        'name' => 'John Doe'
    ),
    array(
        'name' => 'unique:table,field,NULL,id,field1,value1'
    )
);

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆