public findAllPublishedPaginated ( integer $perPage = 50 ) : Illuminate\Contracts\Pagination\LengthAwarePaginator | ||
$perPage | integer | |
return | Illuminate\Contracts\Pagination\LengthAwarePaginator |
public function findAllPublishedPaginated($perPage = 50)
{
return $this->model->where('published_at', '<=', Carbon::now())->with(self::$relations)->orderBy('published_at', 'desc')->paginate($perPage);
}