File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -234,14 +234,14 @@ public function firstOrFail($columns = ['*'])
234
234
* Paginate the given query by 'limit' request parameter
235
235
* @return mixed
236
236
*/
237
- public function smartPaginate ()
237
+ public function smartPaginate ($ perPage = null )
238
238
{
239
239
$ limit = (int ) request ()->input (
240
240
config ('awesio-repository.smart_paginate.request_parameter ' ),
241
241
config ('awesio-repository.smart_paginate.default_limit ' )
242
242
);
243
243
244
- if ($ limit === 0 ) $ limit = config ('awesio-repository.smart_paginate.default_limit ' );
244
+ if ($ limit === 0 ) $ limit = ( $ perPage ) ?: config ('awesio-repository.smart_paginate.default_limit ' );
245
245
246
246
$ maxLimit = config ('awesio-repository.smart_paginate.max_limit ' );
247
247
@@ -263,4 +263,4 @@ public function orderBy($column, $direction = 'asc')
263
263
264
264
return $ this ;
265
265
}
266
- }
266
+ }
You can’t perform that action at this time.
0 commit comments