I want to verify if email address in my database is duplicate or not?
Here is my codes :

```
'users.*.email'=> ['required','unique:users','email']

```

and this is my **Controller**

**UsersController**

```
public function MassStore(MassStoreUserRequest $request)
{

    $inputs = $request->get('users');
    return redirect()->route('admin.users.index');
}

```

and this is my POST data (post data($inputs) will send like as below) :

```
'users' => [
    [
        'name' => 'Ken Tse',
        'email' => 'ken@gamil.com',
        'password' => 'ken12ken34ken',
    ],
    [
        'name' => 'Ken Tse',
        'email' => 'ken@gamil.com',   //duplicate, so need trigger error
        'password' => 'ken12ken34ken',
    ],
]

```

and this is error I get :

> 
> [2019-12-10 15:51:16] local.DEBUG: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '`ken@gamil.com`' for key '`users_email_unique`'
> 
> 
> 

MassStoreUserRequest 

```
public function rules()
{
    return [
        'users'                => ['required','array'],
        'users.*.name'         => ['required'],
        'users.*.email'        => ['required','unique:users','email'],
        'users.*.password'     => ['required','min:8']
    ];
}

```