$productLists = DB::table('A')
->leftJoin('B', function($join) {
$join->where('B.qty','=', 1);
$join->on("B.id", "=", "A.id");
})
->select('A.*','B.*')
->get();
What's wrong with the query?
The field I get from B table all returned null
.
Am I doing it in wrong way?
this is one way to write joins in laravel..