Ozal  Zarbaliyev
Ozal Zarbaliyev

Reputation: 638

Laravel paginator in custom query

I am working on a project in laravel. I have sql queries as string in db. The queries are very important. There is no way to write them in laravel relationships because of some situation so

DB::select($table->query) I wanna paginate this with laravel paginate.

Upvotes: 0

Views: 566

Answers (1)

Asur
Asur

Reputation: 4017

Laravel Query Builder also implements the paginate() method:

DB::table($table->query)->paginate(15);

Check the documentation on this subject for further information.

Upvotes: 1

Related Questions