Improved:
Paginator::currentPageResolver(function ($pageName) {
return empty($_GET[$pageName]) ? 1 : $_GET[$pageName];
});
Reference: https://github.com/illuminate/pagination/blob/master/AbstractPaginator.php#L314
public static function resolveCurrentPage($pageName = 'page', $default = 1)
{
if (isset(static::$currentPageResolver)) {
return call_user_func(static::$currentPageResolver, $pageName);
}
return $default;
}
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community