When I create a pagination manually, it is giving error, it does not create in the view the amount of exact elements as I determine.
On my controller:
public function getIndex(){
$fileClass = FileClass::with(['FileServico'])
->where('status','=','PR')
->where('id_cliente','=',1)
->orderBy('id_file','DESC')
->get()
->toArray();
foreach($fileClass as $fileArr){
foreach($fileArr['file_servico'] as $file){
$f[] = $file;
}
}
return View::make('home')
->with('fileClass',Paginator::make($f, count($f),2));
}
In the view I normally iterate to print the data and it is printed, the pager is usually created at the bottom and makes the exact count as I determine, however, the table that is created does not bring the exact elements. / p>
@foreach($fileClass as $f)
<tr>
<td>{{ $f['id_file'] }}</td>
</tr>
@endforeach
And the pager is right, it usually appears:
@section('pagination')
<section id="pagination">
{{ $fileClass->links() }}
</section>
@stop
At the time of printing the number of elements per page it prints all the elements, below the pager is presented normally, but there is no pagination itself.