In this article I’m going to implement a simple service which could work with Laravel eloquent ORM, it would handle relations and also the basic operators which uses the most. You are developing a RESTful API and want to let your users filter the indexes with different fields or even on the relations of your model.
How could you filter all the articles of a specific user?
Let’s add a filter to our API to find all the articles of user with id = 1.
In the next step, we are going to setup the basic project and then start adding these dynamic filters to that.