Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load nested set by default in Laravel Relation definition #22

Open
JoshuaDoshua opened this issue May 23, 2016 · 1 comment
Open

Load nested set by default in Laravel Relation definition #22

JoshuaDoshua opened this issue May 23, 2016 · 1 comment

Comments

@JoshuaDoshua
Copy link

JoshuaDoshua commented May 23, 2016

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?

@gazsp
Copy link
Owner

gazsp commented Feb 8, 2017

I like this idea but I envisage it being a fair bit of work. Happy for someone to look in to it, or I'll take a look if (when) I get time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants