Implement a new Artisan command and Excel import logic to handle tracking data ingestion. This includes registering new commands in the application bootstrap and providing several utility scripts for debugging and testing the import process. - Add `ImportTrackingData` command and `TrackingDataImport` class - Register `ImportShippingRates` and `ImportTrackingData` in `app.php` - Add `ifnex:import:tracking` closure command in `console.php` - Include various debugging and testing scripts for Excel and shipment verification
14 lines
646 B
PHP
14 lines
646 B
PHP
<?php
|
|
require 'vendor/autoload.php';
|
|
use PhpOffice\PhpSpreadsheet\IOFactory;
|
|
$file = '../01_Documents/Data entry 2026-06-28.xlsx';
|
|
$spreadsheet = IOFactory::load($file);
|
|
$sheetNames = $spreadsheet->getSheetNames();
|
|
echo 'Sheets: ' . implode(', ', $sheetNames) . PHP_EOL;
|
|
$sheet = $spreadsheet->getSheet(0);
|
|
echo 'Sheet 0 name: ' . $sheet->getTitle() . PHP_EOL;
|
|
echo 'Row 1: ' . implode(', ', $sheet->rangeToArray('A1:H1')[0]) . PHP_EOL;
|
|
echo 'Row 2: ' . implode(', ', $sheet->rangeToArray('A2:H2')[0]) . PHP_EOL;
|
|
echo 'Row 3: ' . implode(', ', $sheet->rangeToArray('A3:H3')[0]) . PHP_EOL;
|
|
echo 'Total rows: ' . $sheet->getHighestRow() . PHP_EOL;
|