I'm using Laravel 5.2 and returning an array result set to my view by using the following
return view('home')->with('devices', $devices)
I've attempted to loop through my array data by using the following in blade
@foreach($devices as $device)
{{ $device[name] }} has
{{ $device[views] }}
@endforeach
Using $device[name] throws Use of undefined constant name - assumed 'name'
I've also tried looping through the result like this
@foreach($devices as $device)
{{ $device->name }} has
{{ $device->views }}
@endforeach