<?php

/**
 * Created by PhpStorm.
 * User: mead
 * Date: 2018/7/9
 * Time: 上午11:30
 */

namespace App\Handlers;

use Maatwebsite\Excel\Facades\Excel;

class LoadExcelHandler
{
    public function load($path)
    {
        $data = [];
        Excel::load($path, function ($reader) use (&$data) {
            $reader = $reader->getSheet(0);
            $data = $reader->toArray();
        });
        return $data;
    }
}