laravel excel prevent number format
// in database : 1277192403076020
// in exported excel: 1,27719E+15
// how do i prevent that?
// here example:
<?php
namespace App\Exports\Pages;
use App\Models\YourModel;
use Maatwebsite\Excel\Concerns\FromCollection;
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
use Maatwebsite\Excel\Concerns\WithColumnFormatting;
class PicsExport implements FromCollection, WithColumnFormatting
{
public function collection(){
// ...
}
public function columnFormats(): array{
return [
'A' => NumberFormat::FORMAT_NUMBER, // add this
];
}
}