Export Action - Lifecycle Hooks
Hi All
Ok, so I am using the prebuilt export action and I would like to update certain values in the DB for the rows that are exported. i.e. status Draft - Exported.
Couldn't see anything in the Docs, Is there a lifecycle hook I can use here or is there a better way to tackle this?
Thanks in advance.
6 Replies
It’s all an extension of the exporter class you create. https://filamentphp.com/docs/3.x/actions/prebuilt-actions/export#formatting-the-value-of-an-export-column
Thanks but I believe this is to format the output of the export column value? I want to update the rows inside the Database, on a successful export, specifically a column called Status. I want to know if that rows has already been exported.
I did try this but this overrode the export action.
Code from Adjustment Model
I was hoping there may have been lifecycle hooks so I call the statusUpdate method once the rows had been exported
Did you managed to find a solution to this?
Keen to know if you ever managed this ?
@David | Fortune Validator Should be possible by overriding the
handle
method of the ExportCsv class as it loops through processing the records:
Take a look at this link for how to bind and override: https://filamentphp.com/docs/3.x/actions/prebuilt-actions/export#customizing-the-export-jobThank you. I’ll try it out