title: Product search Query from multiple model
body: <p>I have Two database table one is product and another is product-stock. I need to search product with name, barcode and SKU. The problem is product SKU in product stock table. How can I manage that things.</p>
  <pre class="lang-js prettyprint-override"><code>// $productSku = ProductStock::where('product_id',$product-&gt;id)-&gt;first();
  $product = Product::where('name', 'LIKE', $request-&gt;keyword.'%')
      /* -&gt;orWhere($productSku, 'LIKE', $request-&gt;keyword.'%') */
      -&gt;orWhere('barcode', 'LIKE', $request-&gt;keyword.'%')
      -&gt;orderby('id','desc')
      -&gt;get();
  
  $output = '';
  
  if (count($product) &gt; 0) 
  {
      $output = '&lt;ul class=&quot;list-group&quot;&gt;';
      
      foreach ($product as $row)
      {
          $output .= '&lt;li class=&quot;list-group-item&quot;  onclick=&quot;addProductCart('.$row-&gt;id.')&quot; &gt;';
          $output .= '&lt;div class=&quot;product d-flex align-items-center&quot;&gt;';
  
          $output .= '&lt;div class=&quot;img mr-2&quot;&gt;';
          $output .= '&lt;img src=&quot;'.uploaded_asset($row-&gt;thumbnail_img).'&quot; width=&quot;30&quot; alt=&quot;Product Image&quot;&gt;';
          $output .= '&lt;/div&gt;';
  
          $output .= ' &lt;div class=&quot;pro-nam&quot;&gt;'.$row-&gt;name.'&lt;/div&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;';
      }
  }
  else
  {
      $output = '&lt;ul class=&quot;list-group&quot;&gt;';
      $output .= '&lt;li class=&quot;list-group-item&quot;&gt;'.'No results'.'&lt;/li&gt;';
      $output .= '&lt;/ul&gt;';
  }
  
  return $output;
  </code></pre>