Skip to content

Instantly share code, notes, and snippets.

@zabbarob
Last active August 23, 2016 23:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zabbarob/b8227ac19d3f8d4bf1855ffe8a0bdf06 to your computer and use it in GitHub Desktop.
Save zabbarob/b8227ac19d3f8d4bf1855ffe8a0bdf06 to your computer and use it in GitHub Desktop.
Read an Excel file with Laravel Excel (https://github.com/Maatwebsite/Laravel-Excel)
$sheets = Excel::load($filename)->get();
$firstSheet = $sheets->first();
$header = $firstSheet->first();
$data = $firstSheet->slice(1)->map(function ($row) use ($header) {
return $header->combine($row);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment