SOLVED. My nginx configuration was wrong and now it is fixed.
I have code like this in controller:
$MyItems = AppModelsMyItems::paginate(10);
On URL https://example.com/my-item
it will execute SQL:
array:2 [▼
0 => array:3 [▶]
1 => array:3 [▼
"query" => "select * from `teams` order by `name` asc limit 10 offset 0"
"bindings" => []
"time" => 0.33
]
]
On URL https://example.com/my-item?page=3
it will be the same SQL and the same data in respond. For some reason offset
is always "0". Where did I turn wrong?
2
Answers
Since
AppModelsMyItems
is a class, it should be using scope resolution::
When the left part is an object instance, you use
->
. Otherwise, you use::
The code should be like this