title: Laravel(Lumen) unique validation rule for an array data when updating
body: <p>I am trying to add a unique rule on an array of data and wants to ignore the unique rule to a given id when updating the same record.</p>
  
  <p>When creating a new record I am using rules like</p>
  
  <pre><code>$rules = [
              'provider.*.link' =&gt; 'required|url|unique:providers,link',
          ];
  </code></pre>
  
  <p>and my data array looks like </p>
  
  <pre><code> [provider] =&gt; [
                  [0] =&gt;[
                         [link] =&gt; http://mysite.local/1
                  [1] =&gt;[
                         [link] =&gt; http://mysite.local/1
                ]
  </code></pre>
  
  <p>which works fine. But, when updating same data I can't figure it out how to ignore unique rule to their respective ids. </p>
  
  <p>I know how to do it when there's no array like </p>
  
  <pre><code>'link' =&gt; 'required|url|unique:providers,link,' . $id,
  </code></pre>
  
  <p>but not sure how to use it when data is an array.</p>
  
  <p>My update data array looks like </p>
  
  <pre><code> [provider] =&gt; 
          [
              [0] =&gt;
                  [
                      [id] =&gt; 3
                      [link] =&gt; http://mysite.local/1
                  ]
  
              [1] =&gt;
                  [
                      [id] =&gt; 4
                      [link] =&gt; http://mysite.local/1
                  ]
  
          ]
  </code></pre>
  
  <p>I am using Lumen and using the same function for creating and updating records. 
  Is there's a way to achieve this?</p>