src/Hive/Hive.php
public function resource($className, $settings = [])
    {
        /** @var \Hive\Resource $resource */
        $resource = $this->initPromises(Resource::create($className, $settings, $this));

        foreach ($resource->settings['actions'] as $action => $actionSettings) {
            $methodName = "setup$action";
            if (method_exists($this, $methodName)) {
                $this->{$methodName}($resource);
            }
        }

        return $resource;
    }
public function resource($className, $settings = [])
    {
        /** @var \Hive\Resource $resource */
        $resource = $this->initPromises(Resource::create($className, $settings, $this));

        foreach ($resource->settings['actions'] as $action => $actionSettings) {
            $methodName = "setup$action";
            if (method_exists($this, $methodName)) {
                $this->{$methodName}($resource);
            }
        }

        return $resource;
    }
public function resource ( $ className , $ settings = [ ] ) { /** @var \Hive\Resource $resource */ $ resource = $ this -> initPromises ( Resource :: create ( $ className , $ settings , $ this ) ) ; foreach ( $ resource -> settings [ 'actions' ] as $ action => $ actionSettings ) { $ methodName = "setup$action" ; if ( method_exists ( $ this , $ methodName ) ) { $ this -> { $ methodName } ( $ resource ) ; } } return $ resource ; }
The second most important method.
Will create RESTful routes for MongoDB model.

@param string $className
@param array $settings
@return PromisesTrait|Resource
The second most important method . Will create RESTful routes for MongoDB model .