src/Awjudd/Revisable/Revisable.php
private function deriveRevisions()
    {
        $query = NULL;

        // There are, so look for any revisions
        if($this->hasAlternateRevisionTable())
        {
            $query = \DB::table(static::$revisionTable);
        }
        else
        {
            // Only grab the instances that were trashed
            $query = self::onlyTrashed();
        }

        // Cycle through all of the other respective columns
        foreach(static::$keyColumns as $column)
        {
            // Filter on the key values
            $query->where($column, '=', $this->$column);
        }

        // Check if we only want to keep a certain number of revisions
        if(static::$revisionCount > 0)
        {
            // Only grab the ones that fit
            $query->take($this->revisionCount);
        }

        // Return the query
        return $query->orderBy('created_at', 'desc');
    }
private function deriveRevisions()
    {
        $query = NULL;

        // There are, so look for any revisions
        if($this->hasAlternateRevisionTable())
        {
            $query = \DB::table(static::$revisionTable);
        }
        else
        {
            // Only grab the instances that were trashed
            $query = self::onlyTrashed();
        }

        // Cycle through all of the other respective columns
        foreach(static::$keyColumns as $column)
        {
            // Filter on the key values
            $query->where($column, '=', $this->$column);
        }

        // Check if we only want to keep a certain number of revisions
        if(static::$revisionCount > 0)
        {
            // Only grab the ones that fit
            $query->take($this->revisionCount);
        }

        // Return the query
        return $query->orderBy('created_at', 'desc');
    }
private function deriveRevisions ( ) { $ query = NULL ; // There are, so look for any revisions if ( $ this -> hasAlternateRevisionTable ( ) ) { $ query = \ DB :: table ( static :: $ revisionTable ) ; } else { // Only grab the instances that were trashed $ query = self :: onlyTrashed ( ) ; } // Cycle through all of the other respective columns foreach ( static :: $ keyColumns as $ column ) { // Filter on the key values $ query -> where ( $ column , '=' , $ this -> $ column ) ; } // Check if we only want to keep a certain number of revisions if ( static :: $ revisionCount > 0 ) { // Only grab the ones that fit $ query -> take ( $ this -> revisionCount ) ; } // Return the query return $ query -> orderBy ( 'created_at' , 'desc' ) ; }
Used in order to derive the actual query that is used to grab the revisions.

@return Illuminate\Database\Query\Builder
Used in order to derive the actual query that is used to grab the revisions .