Skip to content

Instantly share code, notes, and snippets.

@zabbarob
Last active Aug 23, 2016
Embed
What would you like to do?
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