Is there a better way than doing multiple queries in my case?

     

I start in laravel and I would like to have your opinion on one point.


I have a controller. In this controller I return a view and several functions that are all SQL queries.


My view must have all these queries because I display different types of foreach. Is this the right way to do or is there something shorter / more appropriate?


My controller :


protected function indexWeb()  {   return view('pages.web.program' [   'getAllCoursesBloc1' => $this->getAllCoursesBloc1()