public function resolve($classname)
    {
        $path = $this->resolveClassname($classname);

        // Check if the resource was found
        if (!class_exists($path)) {

            // If we are on the latest version, stop searching
            if ($this->isLatest()) {
                throw new Exceptions\ResourceNotFoundException($classname, $path);
            }

            // Search on the latest version
            $path = $this->resolveClassname($classname, true);

            // If still does not exists, fail
            if (!class_exists($path)) {
                throw new Exceptions\ResourceNotFoundException($classname, $path);
            }
        }

        return new APIResource($path);
    }
public function resolve($classname)
    {
        $path = $this->resolveClassname($classname);

        // Check if the resource was found
        if (!class_exists($path)) {

            // If we are on the latest version, stop searching
            if ($this->isLatest()) {
                throw new Exceptions\ResourceNotFoundException($classname, $path);
            }

            // Search on the latest version
            $path = $this->resolveClassname($classname, true);

            // If still does not exists, fail
            if (!class_exists($path)) {
                throw new Exceptions\ResourceNotFoundException($classname, $path);
            }
        }

        return new APIResource($path);
    }
public function resolve ( $ classname ) { $ path = $ this -> resolveClassname ( $ classname ) ; // Check if the resource was found if ( ! class_exists ( $ path ) ) { // If we are on the latest version, stop searching if ( $ this -> isLatest ( ) ) { throw new Exceptions \ ResourceNotFoundException ( $ classname , $ path ) ; } // Search on the latest version $ path = $ this -> resolveClassname ( $ classname , true ) ; // If still does not exists, fail if ( ! class_exists ( $ path ) ) { throw new Exceptions \ ResourceNotFoundException ( $ classname , $ path ) ; } } return new APIResource ( $ path ) ; }
Smart builds the classname using the correct version.
If it fails with the current version, it falls back to
the latest version. If it still fails, throw exception.

@param string $classname

@return APIResource
@throws Exceptions\ResourceNotFoundException
Smart builds the classname using the correct version . If it fails with the current version it falls back to the latest version . If it still fails throw exception .