Reputation: 1
I am trying to paginate my results from a database using a Laravel 5.2.31 app, but the pagination isn't working.
When I use {!! $users->links() !!}
in my view, I get an error 'Method links does not exist' .
The same thing happens when I use {!! $users->render() !!}
My Controller:
public function index() {
$users= User::orderBy('created_at', 'desc')->paginate(4);
return view('home', ['users' => $users]);
}
Any help?
Upvotes: 0
Views: 3197
Reputation: 346
Could you please try this:
return \View::make('home')->with('users',$users);
Upvotes: 0