Jul 2, 2023
0
Level 8
Can I pass the data from the created Excel file to the listener with Laravel-Excel?
Hello,
I registered a global event in AppServiceProvider as per the docs: https://docs.laravel-excel.com/3.1/exports/extending.html#global-event-listeners :
Writer::listen(BeforeWriting::class, function () {
//
});
Can I get the data from the exported file?
For example if the event was triggered by the download method, then get the filename:
public function export()
{
return Excel::download(new InvoicesExport, 'invoices.xlsx');
}
So in the listener I will be able to get invoices.xlsx
Thanks
Please or to participate in this conversation.