Mysql
 sql >> Database >  >> RDS >> Mysql

Laravel Eloquent divide la query in array

Questo dovrebbe funzionare per te

@foreach($specifications->groupBy('name') as $name => $specificationGrouped)
    <tr>
        <td>{{ $name }}</td>
        @foreach($specificationGrouped as $specification)
            <td>{{ $specification['detail'] }} ({{ $specification['device_id'] }})</td>
        @endforeach
    </tr>
@endforeach