Jak wyprowadzić najlepszych czytelników z tabeli MySQL
//here we loaded students as well as we need to know the name
//and then group by `student_id`
$book_issues = book_issue::with('student')
->where('issue_date', 'LIKE', '%' . $request->month . '%')
->get()
->groupBy('student_id');
$row = 1;
@foreach($book_issues as $k => $v)
<tr>
<td>{{$row}}</td>
<td>{{$v->first()->student->name}}</td>
<td>{{$$v->count()}}</td>
</tr>
<?php
$row++;
?>
@endforeach
SAMER SAEID