title: Laravel Dynamic Input Validation
body: <p>I'm developing an application, where I'm creating dynamic input. Validation is working properly except one use case.</p>
  
  <p>Validation rule is here:</p>
  
  <pre><code>return [
           '*.id' =&gt; 'nullable|numeric',
           '*.name' =&gt; 'required|min:3|regex:/^[a-zA-Z0-9\s]+$/|unique:products,name,*.id,id,category_id,'.$this-&gt;route('id'),
           '*.quantity_available' =&gt; 'nullable|numeric|min:0',
           '*.quantity_sold' =&gt; 'nullable|numeric|min:0',
           '*.price'=&gt; 'required|numeric|min:10',
           '*.sale_price' =&gt; 'required|numeric|min:10',
         ];
  </code></pre>
  
  <p>Please have a look over the following sent data:</p>
  
  <pre><code>{id: 5, category_id: 3, name: "Test 1", description: null, quantity_available: null, quantity_sold: null, price:40, sale_price:35},
  {id: 6, category_id: 3, name: "Test 2", description: null, quantity_available: null, quantity_sold: null,price:40, sale_price:35},
  {id: "", name: "Test 3", quantity_available: "", quantity_sold: "", price: 40, sale_price: 35}
  </code></pre>
  
  <p>I want the product name to be unique as per the category_id and if a input has id present, then that product id would be ignored while product name unique validation.</p>