Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- the controller
- $id = 7;
- $product = M_productImage::whereHas('product', function($q) use ($id)
- {
- $q->where('productCategory_id','!=', $id);
- })->orderBy('productImage_id','=', 'desc')->groupBy('product_id')->take(4)->get();
- to call in view
- main table
- $product->productImage_id;
- table
- $product->product->product_id;
Advertisement
Add Comment
Please, Sign In to add comment