theProfit's avatar

LeftJoin on Leftjoin

Hi Everybody,

i have a query :

$objects = DB::table('catalog') ->leftJoin('products', 'sku', '=', 'identifier') ->leftJoin('prices','product_id','=','id') ->get();

Now the table products leftjoin on catalog, but i also want prices to leftjoin on products. but it looks like it crashes becauses it tries to join on catalog.

0 likes
1 reply
SilenceBringer's avatar

@theprofit

$objects = DB::table('catalog')
    ->leftJoin('products', 'sku', 'identifier')
    ->leftJoin('prices', 'prices.product_id', 'products.id')
    ->get();

Please or to participate in this conversation.