Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT b.name
- FROM brands b
- INNER JOIN products p
- ON b.id = p.brand_id
- INNER JOIN transaction_sell_lines tr
- ON p.brand_id=tr.product_id
- public function products(){
- return $this->hasMany(Product::class,'brand_id','id');
- }
- public function transactionSellLines(){
- return $this->hasMany(TransactionSellLines::class,'product_id','id');
- }
- Brand::with('products.transactionSellLines')->get();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement