Laravel Method paginate does not exist

Extending a bit Alexey’s perfect answer :

Dispatch::all() => Returns a Collection

Dispatch::all()->where() => Returns a Collection

Dispatch::where() => Returns a Query

Dispatch::where()->get() => Returns a Collection

Dispatch::where()->get()->where() => Returns a Collection

You can only invoke “paginate” on a Query, not on a Collection.

And yes, it is totally confusing to have a where function for both Queries and Collections, working as close as they do, but it is what it is.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)