Laravel Turn Excel en table HTML
// Load the excel sheet and convert values to an array:
$data = Excel::load('file.xls')->toArray();
// Convert the keys from the first entry to an array (i.e. the headers):
$headers = array_keys($data[0]);
// Then construct a table:
<table>
<tr>
@foreach($headers as $h)
<th>{{$h}}</th>
@endforeach
</tr>
@foreach($data as $d)
<tr>
@foreach($d as $v)
<td>{{$v}}</td>
@endforeach
</tr>
@endforeach
</table>
Keep in mind this has no error checking, you should provide some.
Literate Lentil