laravel excel numbers formatted as text still appearing as number

Solutions on MaxInterview for laravel excel numbers formatted as text still appearing as number by the best coders in the world

showing results for - "laravel excel numbers formatted as text still appearing as number"
Romina
09 Feb 2019
1
2I found a workaround by using setCellValueExplicit()
3eg:
4
5$sheet->setColumnFormat(array( //se formatea la columna a texto
6    'C' => \PHPExcel_Style_NumberFormat::FORMAT_TEXT,
7    'I' => 'dd-mm-yyyy hh:mm'
8));
9
10$sheet->setCellValueExplicit('C10', $object->card_number, \PHPExcel_Cell_DataType::TYPE_STRING);
11
12Hope this helps ;)