Laravel-Excel: Target [Maatwebsite\Excel\Exporter] is not instantiable.
Versions
- PHP version: 7.3.5
- Laravel version: 5.8.18
- Package version: 3.1.13
Description
Here my export files
namespace App\Exports;
use Maatwebsite\Excel\Concerns\FromArray;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\Exportable;
class TestExport implements FromArray, WithHeadings
{
use Exportable;
public function headings(): array
{
return [
'id',
'name'
];
}
public function array(): array
{
return [
1,
'John Doe'
];
}
}
return (new TestExport())->download('test.csv', \Maatwebsite\Excel\Excel::CSV, [
'Content-Type' => 'text/csv',
]);
I’m getting following error:
Target [Maatwebsite\Excel\Exporter] is not instantiable.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 17 (5 by maintainers)
@SumantaBee
Go to your
config/app.php
file and addMaatwebsite\Excel\ExcelServiceProvider::class
to the list of the providersFor some reason the auto discover for only this package doesnt work while im running the tests…
I keep getting this error: