Skip to content

parent eager loading failure #365

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

Open
laurentbaig opened this issue Apr 3, 2019 · 1 comment
Open

parent eager loading failure #365

laurentbaig opened this issue Apr 3, 2019 · 1 comment

Comments

@laurentbaig
Copy link

laurentbaig commented Apr 3, 2019

Hi, eager loading of parent seems to work in tinker but when I use in a Controller method

        $categories = Category::with([
            'parent', 'exam',
        ])->get();

I do not receive the parent model back in the loaded categories.

I tried to run the tests and got

There was 1 failure:

1) ScopedNodeTest::testDescendants
Failed asserting that 0 matches expected 1.

/Users/admin/Sites/forest/vendor/kalnoy/nestedset/tests/ScopedNodeTest.php:106

FAILURES!
Tests: 74, Assertions: 199, Failures: 1.

I'm using PHP 7.1.25 and laravel/framework 5.7.9

@laurentbaig laurentbaig changed the title eager loading failure parent eager loading failure Apr 3, 2019
lazychaser added a commit that referenced this issue Jun 16, 2019
V5 - fix support for Laravel 5.7 and 5.8 (fixes #339, #351, #329, #334, #271, #365)
@rafatga
Copy link

rafatga commented May 7, 2020

This following images shows the problem:

DB IMG
Screen Shot 2020-05-07 at 12 28 43 PM

CODE IMG
Screen Shot 2020-05-07 at 12 34 49 PM

RESULT IMG
Screen Shot 2020-05-07 at 12 28 15 PM

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

No branches or pull requests

2 participants