Hello I have a problem with Paginator dont know how I can make it work.
This is my ReportsController:
public function index()
{
//Show all created reports
$reports = Reports::orderBy('created_at', 'desc')->paginate(15);
return view('reports.index', ['reports'=>compact('reports')])->with(['reports', $reports]);
}
And this is the index.blade.php:
@foreach($reports as $report)
<tr>
<td scope="row"><a href="/reports/show">{{$report->id}}</td>
<td>{{$report->title}}</td>
<td>{{$report->category}}</td>
<td>{{$report->name}}</td>
<td>{{$report->created_at}}</td>
<td>{{$report->updated_at}}</td>
</tr>
@endforeach
What you had was this:
If you were going to use
with
it would be: