Vinelab / NeoEloquent

The Neo4j OGM for Laravel
MIT License
633 stars 197 forks source link

Can't save node label #298

Closed nisace closed 5 years ago

nisace commented 5 years ago

Hi,

Thanks for your package ! I am having an issue with node label. I have a very simple NeoEloquent model and I can't manage to set and save a node label.

$node = new Node; 
$node->addLabels(['mylabel']);
$node->save();

I tried with a newly instantiated node and with an existing one. I also tried $node->setLabel('mylabel') but none of that worked.

Thanks !

nisace commented 5 years ago

Actually the following works (but it's a surprising behaviour). Closing the issue.

$node = new Node;
$node->save();
$node->addLabels(['mylabel']);
$node->save();