Welcome Guest, Not a member yet? Register   Sign In
RESTFul route + search terms via querystring
#1

Dear all,

I would like to add a search method to my restful resource controller.

Currently I have this line in my Config\Routes.php:

PHP Code:
$routes->resource('api/products', ['controller' => 'Api\Products']); 


What should I add to my routes to be able to browse to localhost/api/products/?category=food&maxPrice=10 and to call an underlying Api\Products\Search() method with passing the search term(s) to it.

Thank you
Reply


Messages In This Thread
RESTFul route + search terms via querystring - by b126 - 06-29-2022, 08:51 AM



Theme © iAndrew 2016 - Forum software by © MyBB