public static function getParameterKeyPage() { return config('consts.ParameterPage'); }
/** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { $pageKey = Constants::getParameterKeyPage(); $pageSizeKey = Constants::getParameterKeyPageSize(); $page = $this->get($pageKey); $pageSize = $this->get($pageSizeKey); $page = intval($page); $pageSize = intval($pageSize); if ($page < 1) { $page = Constants::getDefaultPage(); $this->query->set($pageKey, $page); } if ($pageSize <= 0) { $pageSize = Constants::getDefaultLimit(); $this->query->set($pageSizeKey, $pageSize); } // force current page to $page Paginator::currentPageResolver(function () use($page) { return $page; }); return true; }