I have wrote some API in my project for getting some data. Now I have a condition for filtering result data. I don't want to repeat the same filtering in each controller, so I decided filtering result after executing. I have to option: using result filter (after fetching data) or using middleware where I will filter data in each request. Could you explain me when I should use result filter and when middleware. Is there any difference in these approaches?
