Mysql
 sql >> Database >  >> RDS >> Mysql

Come farlo in Laravel, subquery where in

Considera questo codice:

Products::whereIn('id', function($query){
    $query->select('paper_type_id')
    ->from(with(new ProductCategory)->getTable())
    ->whereIn('category_id', ['223', '15'])
    ->where('active', 1);
})->get();