@@ -347,6 +347,20 @@ public function search($queries)
347347 });
348348 }
349349
350+ /**
351+ * Set the "limit" value of the query.
352+ *
353+ * @param int $limit
354+ *
355+ * @return self
356+ */
357+ public function limit ($ limit )
358+ {
359+ return $ this ->addScopeQuery (function ($ query ) use ($ limit ) {
360+ return $ query ->limit ($ limit );
361+ });
362+ }
363+
350364 /**
351365 * Retrieve all data of repository
352366 *
@@ -399,31 +413,33 @@ public function pluck($value, $key = null)
399413 /**
400414 * Retrieve all data of repository, paginated
401415 *
402- * @param null $limit
403- * @param array $columns
416+ * @param int $limit
417+ * @param array $columns
418+ * @param int|null $page
404419 *
405420 * @return \Illuminate\Pagination\Paginator
406421 */
407- public function paginate ($ limit = null , $ columns = ['* ' ])
422+ public function paginate ($ limit = null , $ columns = ['* ' ], $ page = null )
408423 {
409424 $ this ->newQuery ();
410425
411- return $ this ->query ->paginate ($ limit , $ columns );
426+ return $ this ->query ->paginate ($ limit , $ columns, $ page );
412427 }
413428
414429 /**
415430 * Retrieve all data of repository, paginated
416431 *
417- * @param null $limit
418- * @param array $columns
432+ * @param int $limit
433+ * @param array $columns
434+ * @param int|null $page
419435 *
420436 * @return \Illuminate\Pagination\Paginator
421437 */
422- public function simplePaginate ($ limit = null , $ columns = ['* ' ])
438+ public function simplePaginate ($ limit = null , $ columns = ['* ' ], $ page = null )
423439 {
424440 $ this ->newQuery ();
425441
426- return $ this ->query ->simplePaginate ($ limit , $ columns );
442+ return $ this ->query ->simplePaginate ($ limit , $ columns, $ page );
427443 }
428444
429445 /**
@@ -648,4 +664,4 @@ public function __call($method, $parameters)
648664
649665 throw new BadMethodCallException ("Call to undefined method {$ className }:: {$ method }() " );
650666 }
651- }
667+ }
0 commit comments