How to customise completed export notification/events?
I want to change the way I receive the completed export notification, or add to it. I want to either broadcast the notification in real time, or send the completed export notification to the UI as well as to the database.
I know I can control this fully in the ExportCompletion.php jobs handle method:
I hear that overriding files like filament/packages/actions/src/Exports/Jobs/ExportCompletion.php is not advised. So what is the best way to customise what happens when an export job completes?
Any help is much appreciated!
5 Replies
bump
bump
bump
I don’t think any one understands exactly what you are trying to do, maybe that why no one has responded.
An example could be to add
event(new DatabaseNotificationsSent($this->export->user));
after the Notification::make()
that is responsible for sending the completed export database notification. or add ->send()
as well as the existing ->sendToDatabase($this->export->user)
for better UX. Something like this:
But I don't want to add this directly to the ExportCompletion.php file.
Does it make more sense now?Sorry, I’m still not totally following. If the you have a custom export then why wouldn’t this be the appropriate place to do it?
Better question, is what you are trying to do work or not?
I have a custom export job, I don't think this can be used to customize or add to the export completion event. I am just hardcoding changes directly into the
filament/packages/actions/src/Exports/Jobs/ExportCompletion.php
plugin file, which does work, but I want to use a better approach for doing this.
Is the best approach to extend the filament/packages/actions/src/Exports/Jobs/ExportCompletion.php
and override it's methods, or is this not a viable way of doing this?