mercredi 18 janvier 2017

Passing variable from backend to frontend laravel

I have 5 controllers and 5 models and they are all related to backend. I can easily output data in the backend but I need to that for the frontend as well. Not all of course but some of them.

For example I have controller called BooksController:

  public function getBooks(Request $request)
{
   $books = Books::all();

   return view('backend.books.show', compact('images'));

}

So this will show it in backend without any problems but what I want is for example to loop through all the books and show their images in welcome.blade.php which doesn't have controller.

And also to pass other parameters to that same view from different controllers.

Is this is possible?

Thank you.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2japQQ8
via IFTTT

Aucun commentaire:

Enregistrer un commentaire