Closed bkrajendra closed 4 years ago
If after installation you got any errors related to the maatwebsite/excel vendor not found: please run from your project's root
composer require maatwebsite/excel:3.1
ok thanks. I'll try.
ok thanks. I'll try.
please give us feedback if that will fix the issue
yes it did fixed the issue.
But in example class, there is Faker
class which was throwing error.
I suggest you to just add User:all()
there to work it properly as Faker
is mostly not installed by default.
But most probably User
will always be there.
This worked for me:
<?php namespace Company\Pluginname\Classes;
use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Events\AfterSheet;
use Company\Pluginname\Models\Profile;
class ExportApplications implements FromCollection, WithHeadings
{
// set the headings
public function headings(): array
{
return \DB::getSchemaBuilder()->getColumnListing('my_profiles_name');
}
// get the data
public function collection()
{
return Profile::all();
}
}
Thanks for suggestion. Added a check for Faker existing in project to prevent the error. And added commented.
Recently Im getting error for latest october build + octoexcel
No special things, just its a fresh install.
Im trying this simple code