You should gather the data you need and pass it into the same view.
For instance:
public function index() {
$teams = Team::all();
$products = Product::all();
return view("main",["teams" => $teams, "products" => $products]);
}
Then, consider that if you have two controllers performing exactly the same method, it is unlikely that you need to have both.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community