Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/blackberry/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何在laravel唯一验证中添加别名_Php_Laravel_Laravel 4 - Fatal编程技术网

Php 如何在laravel唯一验证中添加别名

Php 如何在laravel唯一验证中添加别名,php,laravel,laravel-4,Php,Laravel,Laravel 4,因此,我的表单与字段的别名不同。但是Laravel使用我的别名作为列名。我如何告诉laravel它只是一个别名,并提供另一个字段来代替它 我的代码: $rules = array( 'email1' => 'required|email|unique:users', ); 将其作为第二个参数提供 $rules = array( 'email1' => 'required|ema

因此,我的表单与字段的别名不同。但是Laravel使用我的别名作为列名。我如何告诉laravel它只是一个别名,并提供另一个字段来代替它

我的代码:

 $rules = array(
        'email1'                   => 'required|email|unique:users',
    );

将其作为第二个参数提供

$rules = array(
    'email1'                   => 'required|email|unique:users,your_field_name',
);

请向我们展示表格的代码,并更清楚地解释您试图实现的目标。。。