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;
    }