saravanan mp
saravanan mp

Reputation: 783

Call to a member function paginate() on array in Laravel

Here is my code in laravel,

use Illuminate\Pagination\LengthAwarePaginator;

$result = DB::connection('mysql')->select("select * from login_master")->paginate(5);

Its showing Call to a member function paginate() on array. How to user paginate() in this code.

Upvotes: 2

Views: 5147

Answers (1)

Calin Blaga
Calin Blaga

Reputation: 1373

Try this:

DB::connection('mysql')->table("login_master")->paginate(5);

If using Eloquent:

LoginMaster::paginate(5);

Upvotes: 2

Related Questions