classes/Fields/Listing.php
protected function queryForItems()
    {
        // If there is a parent, run the query through the relationship to this model
        // from the parent
        if ($this->parent_item) {
            $relationship = Decoy::hasManyName($this->name);
            $query = $this->parent_item->$relationship()->ordered();
        }

        // Otherwise, open up the query using ordered
        else {
            $query = call_user_func($this->name.'::ordered');
        }

        // Apply any custom scope
        if ($this->scope) {
            call_user_func($this->scope, $query);
        }

        // Retrieve the results through paginator
        return $query->paginate($this->perPage());
    }
protected function queryForItems()
    {
        // If there is a parent, run the query through the relationship to this model
        // from the parent
        if ($this->parent_item) {
            $relationship = Decoy::hasManyName($this->name);
            $query = $this->parent_item->$relationship()->ordered();
        }

        // Otherwise, open up the query using ordered
        else {
            $query = call_user_func($this->name.'::ordered');
        }

        // Apply any custom scope
        if ($this->scope) {
            call_user_func($this->scope, $query);
        }

        // Retrieve the results through paginator
        return $query->paginate($this->perPage());
    }
protected function queryForItems ( ) { // If there is a parent, run the query through the relationship to this model // from the parent if ( $ this -> parent_item ) { $ relationship = Decoy :: hasManyName ( $ this -> name ) ; $ query = $ this -> parent_item -> $ relationship ( ) -> ordered ( ) ; } // Otherwise, open up the query using ordered else { $ query = call_user_func ( $ this -> name . '::ordered' ) ; } // Apply any custom scope if ( $ this -> scope ) { call_user_func ( $ this -> scope , $ query ) ; } // Retrieve the results through paginator return $ query -> paginate ( $ this -> perPage ( ) ) ; }
Write an execute a query to get the list of items

@return LengthAwarePaginator
Write an execute a query to get the list of items