2
I created the controller Artigocontroller of the kind Resource, then I have the verbs and default routes. I use the method index from my controller to list all articles (paged):
$artigos = Artigo::orderBy('edicao', 'desc')->paginate(25);
return view('painel.artigos.listar', compact('artigos'));
The point is that in my view listar.blade.php, in addition to listing everything, I also have a search input, which in theory does the search and populates that same view, so I know the method index does not accept input parameters, in this case the best is in case the search calls another controller and this points back to the view?
I’m using Laravel 5.6
But in this case as we are talking about Resource, if I pass some parameter I would not be falling into another method like show?
– Fábio Jânio
Not because it only goes to another Source if you use url tracking type /article/field
– Mauricio Wanderley Martins
In this case it is not a parameter in the url, it is simply an extra argument for the method. Note that a
?
to send the fields.– gmsantos