DB::table('products')
->where('status', '=', 'published')
->where('sub_category', '=', 'grooming-wellness')
->where('sub_category', '=', 'beauty-care')
->get();
it doesn't work. it returns 0 data.
DB::table('products')
->where('status', '=', 'published')
->where('sub_category', '=', 'grooming-wellness')
->where('sub_category', '=', 'beauty-care')
->get();
it doesn't work. it returns 0 data.
I am assuming you want to check if a field has a particular value or another value. You can use whereIn to achieve this:
DB::table('products')
->where('status', '=', 'published')
->whereIn('sub_category', ['grooming-wellness', 'beauty-care'])
->get();
Laravel 6.x Docs - Query Builder - Where Clauses - Additional Where Clauses whereIn