Open chao opened 5 years ago
Well, I made some modifications for resolveNode function as following, it works well.
protected function resolveNode($node)
{
if (method_exists($node, 'refresh') && is_callable([$node, 'refresh'])) {
return $node->refresh();
}
if ($node instanceof \Illuminate\Database\Eloquent\Model) {
return $node->newQuery()->find($node->getKey());
}
if (!empty($node)) {
return $this->node->newQuery()->find($node);
}
throw new MoveNotPossibleException('Could not resolve target node.');
}
It works just fine in version 1, but after I upgrade Laravel to 5.8 and Baum to v2.x-dev, I got a exception :
Could not resolve target node.
in Move.php L206.Are we have to use integer as primary key in version 2?