SHARE
TWEET

Untitled

a guest Jun 16th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top