Support the ongoing development of →
4 years ago
Last updated 3 months ago.

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.

Last updated 4 years ago.

Sign in to participate in this thread!


Your banner here too?

Petit Vps Petit Vps petit-vps Joined 15 Mar 2018


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2022 - All rights reserved.