lazychaser / laravel-nestedset

Effective tree structures in Laravel 4-8
3.66k stars 472 forks source link

Node as a Trait? #75

Closed ddimaria closed 8 years ago

ddimaria commented 8 years ago

Have you considered refactoring this as a trait so that it isn't required to extend Node? If not, I can do this in a PR if you think it would be useful as I need that functionality for a project I'm working on. Let me know. Thanks! -David

lazychaser commented 8 years ago

If not, I can do this in a PR if you think it would be useful

What do you mean?

ddimaria commented 8 years ago

You currently have to extend Node rather than extend Eloquent for your package to work. I created a Pull Request converting this to a PHP Trait (http://php.net/manual/en/language.oop5.traits.php), which is more flexible and allows for multiple inheritance of model traits (see https://github.com/laravel/framework/blob/5.1/src/Illuminate/Database/Eloquent/SoftDeletes.php as an example).

pet1330 commented 8 years ago

This is closed by #76. The documentation in the model section of the readme.md file needs updating though :smile:

lazychaser commented 8 years ago

Done