vdomah / octoexcel

OctoberCMS wrapper for Maatwebsite/Laravel-Excel
MIT License
14 stars 10 forks source link

Save export to disk #13

Open vosco88 opened 4 years ago

vosco88 commented 4 years ago

How can I use this to save the exported file to disk?

vdomah commented 4 years ago

Check please the example from docs: https://github.com/vdomah/oc-botman-plugin/blob/master/classes

vosco88 commented 4 years ago

I am able to get the data on the frontend and download the csv. My use case is that I would like to run the export from OctoberCMS Scheduler and store it on s3 automatically let's say once a week. And I can't seem to figure it out. The Excel::export method triggers the download method of the excel instance. How would I trigger the store() method as per documentation for Laravel Excel https://docs.laravel-excel.com/3.1/exports/store.html?

Thank you

On Sat, 23 May 2020 at 09:02, vdomah notifications@github.com wrote:

Check please the example from docs: https://github.com/vdomah/oc-botman-plugin/blob/master/classes

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/vdomah/octoexcel/issues/13#issuecomment-632998191, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADNVARM4BDUITCPS7UEYUI3RS5YINANCNFSM4M677S5A .

vdomah commented 4 years ago

Can't help with this case for now because I haven't such task yet. So may be better to ask about it on laravel-excel resources

chrisvidal commented 3 years ago

@vosco88 did you manage to save your exprt on the disk? I am having the same requirements, building nightly file export and send them by email attachments $file = Excel::export(new ExportSubmissions($digestData), 'preschool_'.$key);

chrisvidal commented 3 years ago

creating a PR for it

vosco88 commented 3 years ago

@chrisvidal I have my exports built according to Laravel Excel documentation. Then when I use this:

use Vdomah\Excel\Classes\Excel Excel::excel()->store(new UsersExport(), 'users.csv', 's3');

it works. I am saving the excels into Amazon S3, but if you ommit that last argument it should save it into the storage folder.

@vosco88 did you manage to save your exprt on the disk? I am having the same requirements, building nightly file export and send them by email attachments $file = Excel::export(new ExportSubmissions($digestData), 'preschool_'.$key);