Is there a way to make it such that when we call php artisan make:export
, the default export file generated implements FromView
and not FromCollection
?
Is there a way to make it such that when we call php artisan make:export
, the default export file generated implements FromView
and not FromCollection
?
2
Answers
if you need collection you need to import its :
and
and using like thats :
Yes, we can do that by editing
stubs
. You can follow these steps:Run
php artisan vendor:publish --provider="MaatwebsiteExcelExcelServiceProvider"
to publish assets.Open
stubs/export.plain.stub
file and replace the following code.php artisan make:export