1 year ago
#67801

Tarenk 77
laravel Pagination empty data when there are not enough records
I am implementing a datatable and I have an error when I select the last page and show 50 records, which is the maximum, this query returns nothing. Isn't it supposed to show the amount of data that exists? There is no conditional in the pagination to put an equal or less?, how can I solve it?
public function render()
{
$cli = Client::where('name','like','%'.$this->search.'%')
->orwhere('last_name','like','%'.$this->search.'%')
->orderBy($this->sort, $this->direction)
->paginate($this->cant);
return view('clients.index', compact('cli'))->extends('layouts.template')->section('content');
}
laravel
bootstrap-4
laravel-livewire
0 Answers
Your Answer