public function paginated()
    {
        $model = $this->model;

        if (isset(request()->dir) && isset(request()->field)) {
            $model = $model->orderBy(request()->field, request()->dir);
        } else {
            $model = $model->orderBy('created_at', 'desc');
        }

        return $model->paginate(config('cms.pagination', 25));
    }
public function paginated()
    {
        $model = $this->model;

        if (isset(request()->dir) && isset(request()->field)) {
            $model = $model->orderBy(request()->field, request()->dir);
        } else {
            $model = $model->orderBy('created_at', 'desc');
        }

        return $model->paginate(config('cms.pagination', 25));
    }
public function paginated ( ) { $ model = $ this -> model ; if ( isset ( request ( ) -> dir ) && isset ( request ( ) -> field ) ) { $ model = $ model -> orderBy ( request ( ) -> field , request ( ) -> dir ) ; } else { $ model = $ model -> orderBy ( 'created_at' , 'desc' ) ; } return $ model -> paginate ( config ( 'cms.pagination' , 25 ) ) ; }
Returns all paginated items.

@return \Illuminate\Database\Eloquent\Collection|static[]
Returns all paginated items .