A few months back I sent a slack message to my team celebrating 3 years since I started a brand new Laravel project dedicated for our reporting service. Over the course of 3 long years this project has accumulated approximately 175 APIs and a rich set of non-functional requirements that includes date filtering, property filter, user-bound data restriction, dynamic pagination, CSV export, Trend (group by time), Stack (group by properties), Year to Year comparison and maybe a few more that I may be forgetting about.
With this set of components, building a Trend or Correlation Report is a matter of writing a few lines of Repository class that will tie together the Table and the user parameters with the EloquentTrend class.
This is an extremely powerful tool that allows for code that is easy to reason about and navigate without sacrificing the developer’s ability to make decision about how the final query will play out.
This is a super neat trick that will allow me to expand several reports with the capability of doing year to year comparison or maybe even user-defined period comparison and I’m looking forward to what users will be doing with these capabilities.