Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

gowthamselvaraj's avatar

Dynamic Reports Generation in laravel

I'm trying to develop a custom reports generation for my application, in which the user will dynamically input the model and its related model.And will select the related columns for which the report is needed and will have conditional statements for 'AND' and 'OR' conditions.

The same functionality is done is vtiger ,Zoho CRM and sales force .

My doubt is which is the efficient way of doing it.

1.Either by creating tables for each modules and defining its column in database 2.Or by providing a config file for all the set up 3.Or by creating a model class for all reports and defining its related model attributes and binding data using getter and setter(accessors and mutators). 4.Or suggest me any other preferrable method or any packages with have minimal functionalities relating this

I know is complex but please suggest me few hints from your point of view.

Please find the below for the flow.

http://i.stack.imgur.com/Kjr2t.png

http://i.stack.imgur.com/5Y7Dx.png

0 likes
2 replies
developer@eventiq.com's avatar

Hey, I am trying to do the same... kinda.

Our company situation is that we want to generate reports for customers, mostly payments and deposits related to activities that users that are attached to one organization is doing.

So we need to loop thru the whole activities and check for the payments that were done, but for that we have filters and columns to compare that will make the query even more complex, for example we want to get a report of the current month and for that we need to check all the activities that were made in the current month and get all the payments to generate a report, and separate them by accounting fee codes so , lets imagine we have 20 activities, it is not big deal at all, but the real problem start when you have thousands of records to process, we are still searching for the right way of doing it because people might generate reports of huge quantities of payment logs which will slow or even kill the server, so I am not sure what laravel offers to accomplish this kind of scaling issues with big searches in the server.

I know that with Eloquent we have relationships and we can get all the data with buildQuery, but all my test cases are with no more than couple of dozens of records, If you or some one find like a good solution to iterate between a lot of Models to get information in an efficient way, please share it with us.

Please or to participate in this conversation.