Api\StarterKit\Utils\Constants::getParameterKeyPageSize PHP Method

getParameterKeyPageSize() public static method

Get the page size parameter key
public static getParameterKeyPageSize ( ) : mixed
return mixed
    public static function getParameterKeyPageSize()
    {
        return config('consts.ParameterPageSize');
    }

Usage Example

 /**
  * 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;
 }
All Usage Examples Of Api\StarterKit\Utils\Constants::getParameterKeyPageSize