V
V
Vitaly Vitaly2015-01-24 17:54:41
Laravel
Vitaly Vitaly, 2015-01-24 17:54:41

How to assign keys when using paginate?

Hello, I have the code:

DB::table($this->table)
                ->select(array('id', 'title', 'type', 'city', 'amount', 'counts', 'weekend'))
                ->orderBy('id', 'asc')
                ->remember(60)
                ->paginate(10);

This code makes 2 queries: 1. count, 2. select, I need to specify certain keys, but if I specify it in remember(60, key), then the first query overwrites the second one and gives an error.
How can you assign 2 keys in this case?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vyacheslav Barsukov, 2015-02-22
@slavabars

DB::table($this->table)
->select(array('id', 'title', 'type', 'city', 'amount', 'counts', 'weekend'))
->orderBy( 'id', 'asc')
->remember(60)
->paginate(key, 10);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question