Laravel Excel numbers formatted as text still appearing as number
I found a workaround by using setCellValueExplicit()
eg:
$sheet->setColumnFormat(array( //se formatea la columna a texto
'C' => \PHPExcel_Style_NumberFormat::FORMAT_TEXT,
'I' => 'dd-mm-yyyy hh:mm'
));
$sheet->setCellValueExplicit('C10', $object->card_number, \PHPExcel_Cell_DataType::TYPE_STRING);
Hope this helps ;)
Also in PHP:
- date time with am pm in php
- datetime format laravel
- current ip in php
- count number of characters in a string in php
- date functions in php
- add page nos. to existing pdf in php
- array key exists laravel
- case upper php
- failed to open stream permission denied laravel
- clear route cache laravel
- check is home page
- file_get_contents timeout
- F d php
- check if key of array key true or false php
- array merge in php
- create guid in php
- create dir php
- artisan create seeder
- composer get php version
- Call to undefined function App\Models\str_slug()
- catching exceptions php
- error reporting set 0 in php
- error reporting php all
- Generate Laravel Migrations from an existing database