protected function getRelationAccessor(ForeignRelationship $collection)
    {
        return sprintf(
            '$%s = %s::pluck(\'%s\',\'%s\')->all();',
            $collection->getCollectionName(),
            $collection->getForeignModel(),
            $collection->getField(),
            $collection->getPrimaryKeyForForeignModel()
        );
    }
protected function getRelationAccessor(ForeignRelationship $collection)
    {
        return sprintf(
            '$%s = %s::pluck(\'%s\',\'%s\')->all();',
            $collection->getCollectionName(),
            $collection->getForeignModel(),
            $collection->getField(),
            $collection->getPrimaryKeyForForeignModel()
        );
    }
protected function getRelationAccessor ( ForeignRelationship $ collection ) { return sprintf ( '$%s = %s::pluck(\'%s\',\'%s\')->all();' , $ collection -> getCollectionName ( ) , $ collection -> getForeignModel ( ) , $ collection -> getField ( ) , $ collection -> getPrimaryKeyForForeignModel ( ) ) ; }
Gets the relation accessor for the given foreign renationship.

@param CrestApps\CodeGenerator\Models\ForeignRelationship $collection

@return string
Gets the relation accessor for the given foreign renationship .