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 = ['*'])
234234 * Paginate the given query by 'limit' request parameter
235235 * @return mixed
236236 */
237- public function smartPaginate ()
237+ public function smartPaginate ($ perPage = null )
238238 {
239239 $ limit = (int ) request ()->input (
240240 config ('awesio-repository.smart_paginate.request_parameter ' ),
241241 config ('awesio-repository.smart_paginate.default_limit ' )
242242 );
243243
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 ' );
245245
246246 $ maxLimit = config ('awesio-repository.smart_paginate.max_limit ' );
247247
@@ -263,4 +263,4 @@ public function orderBy($column, $direction = 'asc')
263263
264264 return $ this ;
265265 }
266- }
266+ }
You can’t perform that action at this time.
0 commit comments