Question: How to automatically trigger an export when a model's status changes?
I'm trying to automatically generate an export whenever a model's status attribute changes to a specific value, without using Filament's export action. I want to use the same 'exporter' class as the output has been approved by the client.
For example, when the status changes to "completed", I'd like to trigger the export process. A notification when the export is generated would be nice but isn't required.
I'm looking for guidance on how to programmatically trigger Filament's export functionality. Has anyone implemented something similar or can point me in the right direction?
Environment:
- Laravel 11.36.1
- Filament 3.2.131
4 Replies
You would want to create an observer and trigger, something like this that AI generated should be along the lines of the attache dthanks to Claude.ai.
It was the Export Model bit I hadn't understood. The tiggerExport makes that clear now. Thanks heaps!
Also, I use Claude too, but I find it gets pretty dreamy with filament and gives me back stuff that doesn’t work at all. Which is fine. Filament is truly very nice to use.
But I’m curious what question you asked for the above.
Again, thank you. I really appreciated it.
Carl
I gave it the export doc link and the first response wasn’t right and I asked it more to focus on using filamentphp export class