A sample of filtering strategy using Laravel and PHP.
$ git clone git@github.com:wheesnoza/laravel-advanced-filter.gitIn the project root directory execute make init command.
$ make init
Fetch all products.
$ curl -X GET 'http://localhost/api/products'Access to http://localhost/products
You can view the results on the web using the same url without the /api route.
- Filter by name.
$ curl -X GET 'http://localhost/api/products?filter[name]=スラックス'- Filter by price. Lower than equal filter.
$ curl -X GET 'http://localhost/api/products?filter[price:lte]=30000'- Filter by price. Greater than equal filter.
$ curl -X GET 'http://localhost/api/products?filter[price:gte]=30000'- Filter by price range.
$ curl -X GET 'http://localhost/api/products?filter[price:gte]=5000&filter[price:lte]=20000'And many others filter options.
- Brand
- Raiting
- Size range
- Free shipping