Illuminate\Database\Eloquent\Model::getPerPage PHP Method

getPerPage() public method

Get the number of models to return per page.
public getPerPage ( ) : integer
return integer
    public function getPerPage()
    {
        return $this->perPage;
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * Paginate the given query into a simple paginator.
  *
  * @param  int  $perPage
  * @param  array  $columns
  * @return \Illuminate\Contracts\Pagination\Paginator
  */
 public function simplePaginate($perPage = null, $columns = ['*'])
 {
     $page = Paginator::resolveCurrentPage();
     $perPage = $perPage ?: $this->model->getPerPage();
     $this->skip(($page - 1) * $perPage)->take($perPage + 1);
     return new Paginator($this->get($columns)->all(), $perPage, $page, ['path' => Paginator::resolveCurrentPath()]);
 }
All Usage Examples Of Illuminate\Database\Eloquent\Model::getPerPage
Model