Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. SELECT b.name
  2. FROM brands b
  3. INNER JOIN products p
  4. ON b.id = p.brand_id
  5. INNER JOIN transaction_sell_lines tr
  6. ON p.brand_id=tr.product_id
  7.  
  8. public function products(){
  9. return $this->hasMany(Product::class,'brand_id','id');
  10. }
  11.  
  12. public function transactionSellLines(){
  13. return $this->hasMany(TransactionSellLines::class,'product_id','id');
  14. }
  15.  
  16. Brand::with('products.transactionSellLines')->get();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement