After doing a paginated query on a model, I manually add some custom fields to my query result collection. These fields are calculated based on queries made on an external database so there is no way I can merge all this in a single query, which obviously would solve everything.
So I would like to know if there is way either to post-filter wither to post-sort a query result, which is paginated.
I see your point and that could work BUT the field-calculation process takes ages so I really need to limit myself to an already-paginated query result.
I'm sorry but I still don't understand your answers. I already used the LengthAwarePaginator class to paginate an array on another project but I can't see how this will resolve my issue.
Summary: query with a lot of results -> additional custom fields manually calculated* -> sorting the results by one of the manually-calculated field -> paginating.
Issue: This is way too long to process due to my big number of query results. So I would like to calculate the custom fields only on a subset of query results, to calculate only the custom fields I need on the first page of pagination. BUT obviously I need to calculate all the fields before I get such an info.
Endless issue then... :-(
The manually fields are calculated querying an external database, so there is no way I can do a JOIN query.
You cannot think outside of the box you have to remove the Box.
At a trucking company I would dump monthly the data and on local database connected via odbc connection using Microsoft Access I would do the actual month end reports.
But there are other Alternatives besides Microsoft Access because a large month-end reports on a desktop database is a zillion times more efficient than anything you can ever ever ever do on the web.
Heck I miss the old debase 3 days which was my first thing I ever learned to program in the late 80s.