I was using data table template for frontend. It already have per page and pagination and search. So, how should I do for query. I did like this. I also wanna use search and paginate from template datatable.
public function index()
{
$users = User::all();
return view('users.list', compact('users'));
}
2
Answers
You should customised your code to do so and here you go:
You can use the laravel built-in pagination:
Then in your view you can loop through your user list and use the pagination links like this:
{{ $users->links() }}