You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have multiple index pages that have up to 10 filter fields (depending on the index page) filters, plus sorting options. When the user applies a filter I generate the appropriate Eloquent query, and I serialize it to store in the session, in case they decide to export the data. I have the following query() method:
The aim is to keep the export classes as simple as possible, with all the logic for applying the filters and sorts in one place: the index() method of the resource controller.
The problem is, that the wheres and orders properties of the query object are being ignored when the export is produced.
I have checked in the exportQuery() method of QueuedWriter, and it is using the correct query to calculate $count but then using a plain query against the model class when actually exporting.
Is there any way to achieve what I am trying to do?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have multiple index pages that have up to 10 filter fields (depending on the index page) filters, plus sorting options. When the user applies a filter I generate the appropriate Eloquent query, and I serialize it to store in the session, in case they decide to export the data. I have the following
query()
method:The aim is to keep the export classes as simple as possible, with all the logic for applying the filters and sorts in one place: the
index()
method of the resource controller.The problem is, that the
wheres
andorders
properties of the query object are being ignored when the export is produced.I have checked in the
exportQuery()
method ofQueuedWriter
, and it is using the correct query to calculate$count
but then using a plain query against the model class when actually exporting.Is there any way to achieve what I am trying to do?
Beta Was this translation helpful? Give feedback.
All reactions