I have the same problem.
Jul 12, 2017
5
Level 3
Node must exists error in Nestedset
Im using kalnoy/nestedset package for nesting categories but there's an error when creating a new child category
Here is thei first part of the error after submitting the create form
(1/1) LogicException
Node must exists.
in NodeTrait.php (line 1181)
Here is the code that i use for my Post categories model
use Illuminate\Database\Eloquent\Model;
use Kalnoy\Nestedset\NodeTrait;
class PostCategories extends Model
{
use NodeTrait;
protected $fillable = [
'title', 'parent_id',
];
}
Here is the code to store in my Post categories controller
$category = PostCategories::create($input->all());
return redirect()
->route('post_categories.show', [ $category->getKey() ]);
I dont know if i just missed something in the package documentation while implementing it
Regards
Please or to participate in this conversation.