public function getCategory($id)
{
$category = Category::with(['products' => function($query) use($id) {
$query->whereId($id);
$query->where('price', '<', '500.00');
}])->get();
}
Doesn't actually solve anything. I am concerned about making the pagination. Is there any fix to that?
what about this:
return Category::find( $category_id )->products()->where( 'price', '<', 500 )->paginate( 6 );
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community