etrepat / baum

Baum is an implementation of the Nested Set pattern for Laravel's Eloquent ORM.
http://etrepat.com/baum
MIT License
2.24k stars 460 forks source link

Native Implementation #198

Open AdamGold opened 8 years ago

AdamGold commented 8 years ago

Hi, I am trying to implement baum to Eloquent without using Laravel (so no service providers). All I do is extend my Model with \Baum\Node. Now, when I use the makeRootOf method:

$category->makeChildOf($parentCategory);

I get this error:


Catchable fatal error: Argument 1 passed to Baum\Move::setEventDispatcher() must be an instance of Illuminate\Events\Dispatcher, null given, called in /vendor/baum/baum/src/Baum/Move.php on line 73 and defined in /vendor/baum/baum/src/Baum/Move.php on line 337

Is it impossible to implement this feature without Laravel or am I doing something wrong?

benharold commented 8 years ago

I had the same problem, but luckily found the solution here: https://github.com/etrepat/baum/issues/196#issuecomment-155707912