Custom logic after import completed

Hello. Is it possible to run custom logic after a import has completed?. I need to import a CSV file with X records and I need to run a new Job after all the records have been imported. The lifecycle hooks seems to be for each imported record but I need to run the logic once all the records have been processed. Thanks.
2 Replies
badriysha
badriysha5mo ago
how about using after() method on actions?
Action::make('actionName')
->action()
->after(
// define custom logic here
);
Action::make('actionName')
->action()
->after(
// define custom logic here
);
Jean Roumeau
Jean RoumeauOP5mo ago
Good one. Seems obvious. Will try now to see if the method is called after the Bus is finished. Thanks. Well. That didn't work. The after doesn't wait for the queue to complete so it is been triggered after the job is enqueued and not after all the jobs have completed.
Want results from more Discord servers?
Add your server