protected function resolve($column, $key, $last, callable $callback)
    {
        if (! strpos($column, '.')) {
            return $callback("{$last}.{$column}", $key);
        }

        $scope = strstr($column, '.', true);
        $singular = str_singular($scope);
        $next = substr(strstr($column, '.'), 1);

        if (! in_array($scope, $this->loaded)) {
            $this->loaded[] = $scope;

            $this->builder->join($scope, "{$last}.{$singular}_id", "{$scope}.id");
        }

        return $this->resolve($next, $key, $scope, $callback);
    }
protected function resolve($column, $key, $last, callable $callback)
    {
        if (! strpos($column, '.')) {
            return $callback("{$last}.{$column}", $key);
        }

        $scope = strstr($column, '.', true);
        $singular = str_singular($scope);
        $next = substr(strstr($column, '.'), 1);

        if (! in_array($scope, $this->loaded)) {
            $this->loaded[] = $scope;

            $this->builder->join($scope, "{$last}.{$singular}_id", "{$scope}.id");
        }

        return $this->resolve($next, $key, $scope, $callback);
    }
protected function resolve ( $ column , $ key , $ last , callable $ callback ) { if ( ! strpos ( $ column , '.' ) ) { return $ callback ( "{$last}.{$column}" , $ key ) ; } $ scope = strstr ( $ column , '.' , true ) ; $ singular = str_singular ( $ scope ) ; $ next = substr ( strstr ( $ column , '.' ) , 1 ) ; if ( ! in_array ( $ scope , $ this -> loaded ) ) { $ this -> loaded [ ] = $ scope ; $ this -> builder -> join ( $ scope , "{$last}.{$singular}_id" , "{$scope}.id" ) ; } return $ this -> resolve ( $ next , $ key , $ scope , $ callback ) ; }
Recursively build up the query.

@param  string  $column
@param  string  $key
@param  string  $last
@param  callable  $callback
@return void
Recursively build up the query .