I'm using Laravel 5.8 and I have added Maatwebsite package for exporting CSV files from a database table.
And here is my exported class:
class ConfirmedExport implements FromCollection, WithHeadings
{
public function headings():array{
return [
];
}
public function collection()
{
return collect(WithdrawWallet::getData());
}
}
And the result looks like this:
"123456789","2100","Desc","lname","fname"
But I need to remove double quotations (" ") from the words, so the expected result looks like this:
123456789,2100,Desc,lname,fname
So how to do that?
UPDATE #1:
I just tried this code for Export Class:
namespace App\Exports;
use App\WithdrawWallet;
use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\WithHeadings;
class ConfirmedExport implements FromCollection, WithHeadings
{
public function headings():array{
return [
];
}
public function collection()
{
return collect(WithdrawWallet::getData());
}
public function getCsvSettings(): array
{
return [
'enclosure' => ''
];
}
}
And it successfully removes the " " from the last element (which is: 123456789), but still shows the " " for the other ones!
