Load nested set by default in Laravel Relation definition #22
Open
Description
Thanks so much for taking this project over!!
Is there a way to eager load a nested relationship using Laravel's relationship definitions instead of calling ->toHierarchy()
?
i.e.
class Post extends Model
{
public function categories()
{
return $this->hasManyRootsWithDescendants(Category::class);
}
}
to return a nested set of categories
If this is a feature request I'd be glad to take a look Or is there a better way to load a nested set by default?