I need to grab rows of users where rows of items exist. Here is my code so far:
$users = DB::table('users')
->join('orders', 'orders.user_id', '=', 'users.id')
->join('items', 'items.user_id', '=', 'users.id');
How do I add a where condition that will only select users that have at least one item?
Aucun commentaire:
Enregistrer un commentaire