You can simply use relationship query like this to bring all products corresponding to the category.
$result = Category::find($id)->with('products'); return $result;
By:Xtreem Solution
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community