File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -158,7 +158,8 @@ public function paginate(
158
158
$ perPage = null ,
159
159
$ columns = ["* " ],
160
160
$ pageName = "page " ,
161
- $ page = null
161
+ $ page = null ,
162
+ $ total = null
162
163
) {
163
164
if (! $ this ->isCachable ()) {
164
165
return parent ::paginate ($ perPage , $ columns , $ pageName , $ page );
@@ -169,8 +170,18 @@ public function paginate(
169
170
if (is_array ($ page )) {
170
171
$ page = $ this ->recursiveImplodeWithKey ($ page );
171
172
}
173
+
172
174
$ columns = collect ($ columns )->toArray ();
173
- $ cacheKey = $ this ->makeCacheKey ($ columns , null , "-paginate_by_ {$ perPage }_ {$ pageName }_ {$ page }" );
175
+ $ keyDifferentiator = "-paginate_by_ {$ perPage }_ {$ pageName }_ {$ page }" ;
176
+
177
+ if ($ total !== null ) {
178
+ $ total = value ($ total );
179
+ $ keyDifferentiator .= $ total !== null
180
+ ? "_ {$ total }"
181
+ : "" ;
182
+ }
183
+
184
+ $ cacheKey = $ this ->makeCacheKey ($ columns , null , $ keyDifferentiator );
174
185
175
186
return $ this ->cachedValue (func_get_args (), $ cacheKey );
176
187
}
You can’t perform that action at this time.
0 commit comments