Laravel 5.3
Package 2.1.2
Guys is it possible chose the disk from Laravel Filesystem on the store method?
I would like to do something like:
Excel::create($filename, function($excel) use($leads) {
$excel->sheet('export_leads', function($sheet) use($leads) {
$sheet->loadView('tenants.exports.leads')
->with('leads', $leads);
});
})->store('xls', 's3');
or even
$file = Excel::create($filename, function($excel) use($leads) {
$excel->sheet('export_leads', function($sheet) use($leads) {
$sheet->loadView('tenants.exports.leads')
->with('leads', $leads);
});
})->export('xls');
\Storage::disk('s3')->put('export', $file, 'public');
Any ideas?
Filesystem is not supported out of the box. You might try the following:
$file = Excel::create($filename, function($excel) use($leads) {
$excel->sheet('export_leads', function($sheet) use($leads) {
$sheet->loadView('tenants.exports.leads')
->with('leads', $leads);
});
})->string('xls');
\Storage::disk('s3')->put('export', $file, 'public');
string() returns the raw content.
Most helpful comment
Filesystem is not supported out of the box. You might try the following:
string()returns the raw content.