public function defineRelation(string $resource, \Closure $closure, string $description = null)
    {
        $this->relations->push(new ResourceDefinition($this->version, $resource, $description));

        $resourceDefinition = $this->relation($resource, $this->version);
        call_user_func_array($closure, [$resourceDefinition]);

        return $this;
    }
public function defineRelation(string $resource, \Closure $closure, string $description = null)
    {
        $this->relations->push(new ResourceDefinition($this->version, $resource, $description));

        $resourceDefinition = $this->relation($resource, $this->version);
        call_user_func_array($closure, [$resourceDefinition]);

        return $this;
    }
public function defineRelation ( string $ resource , \ Closure $ closure , string $ description = null ) { $ this -> relations -> push ( new ResourceDefinition ( $ this -> version , $ resource , $ description ) ) ; $ resourceDefinition = $ this -> relation ( $ resource , $ this -> version ) ; call_user_func_array ( $ closure , [ $ resourceDefinition ] ) ; return $ this ; }
defines a relation

@param string $resource
@param \Closure $closure
@param string $description
@return $this
defines a relation