Closed pllealfunes closed 2 years ago
Hi @pllealfunes it looks like the issue you are running into may be in your search function of your SearchController.php file. I think once a function hits a return statement it stops running.
@gabichuela85 Is correct. That return $searchResults;
is causing the code to stop there. Try omitting it altogether.
There's no need to return $searchResults
. You simply need to populate it with data and then pass it to the view - both things you're already doing.
If that doesn't get it working as expected, let us know.
It worked! Thanks @gabichuela85 and @susanBuck
Hey guys,
I was trying to follow the steps under the FORMS:GET notes for my p2 form but I am unable to display the results on the same page the form was submitted which is also my home page. After I fill out the form I am taken to another page that displays the results as an array. How can I get the results to show on the same page under my form?
My Form
After submitting results
home.blade.php
@endsection
SearchController.php <?php
PageController.php
routes