Put it in a crud/base controller and pass in the "item" as a variable.
public function index($foo)
{
$plural = str_plural($foo);
$data = $this->$foo->get();
return view( $plural.'.index', [ $plural =>$data ] );
}
That is nice and simple.
Thanks landjea
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community