---
title: "laravel excel  Maatwebsite导入的数据下标从1开始（原来是0)"
author: "ipython"
date: "2016-07-26T19:49:52Z"
tags: []
categories: ["编程语言"]
slug: "laravel-excel-maatwebsite-1-0"
draft: false
lastmod: "2016-07-26T19:49:52Z"
id: 2313565
url: "https://ipython.iteye.com/blog/2313565"
---

之前手多执行了一下composer update,然后发现导入的数据有问题，后来发现的laravel excel的toArray()返回的数据有问题，原来的下标是从0开始的，现在是从1开始。

Github有这个issue : https://github.com/Maatwebsite/Laravel-Excel/issues/856

原来是新的版本(2.1.3)有这个问题

解决方法：将Maatwebsite降级即可：修改composer.json   "maatwebsite/excel": "2.1.2"  指定版本，再 composer update 就可以了。