Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

htoogyi's avatar

Excel import date column miss format on Maatwebsite and I get float value form date cell

0 likes
7 replies
htoogyi's avatar

How to upload screenshot. I am using Maatwebsite 3.1 , PHP 7.0.30 (cli) (built: Apr 24 2018 16:30:44) ( ZTS ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies ,

$ php artisan -v Laravel Framework 5.5.48

Excel Version 2016

cookie_good's avatar

I dont know if this is the right answer for everyone, but usually when Im using maatwebsite I also use PHPoffice. I have a method for generating the file with maatwebsite and then I have a method for manipulating the file with PHPoffice. And thats usually where I set my cell format.

htoogyi's avatar

I want to read multi sheets , Do PHPoffice okay ? I found single sheet with PHPoffice $reader = new \PhpOffice\PhpSpreadsheet\Reader\Xlsx(); $spreadsheet = $reader->load($_FILES['file']['tmp_name']); $sheetData = $spreadsheet->getActiveSheet()->toArray(); dd($sheetData);

cookie_good's avatar

PHP office will allow you to select a sheet or create a sheet based on the index number or the sheet name, just like visual basic. Theres really not much you can do with a visual basic that you cant do with PHP office.

cookie_good's avatar

PS. The reason youre only getting one sheet, is because you used the getactivesheet command. This is correct, but you have to select the sheet that you want before you die and dump. So select a sheet, and then die and dump.

cookie_good's avatar

Im not in front of my computer, but when I get home, Ill give you some sample code

Please or to participate in this conversation.