Skip to content

V5 - fix support for Laravel 5.7 and 5.8 (fixes #339, #351, #329, #334, #271, #365) #370

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

Merged
merged 3 commits into from
Jun 16, 2019

Conversation

Ciaro
Copy link
Contributor

@Ciaro Ciaro commented Apr 21, 2019

Hi,

Thank you very much for this great library!

However, the way eager loading is handled in Laravel has changed since the
original implementation of the NestedSet library. In the current version v4 it is not possible
any more to apply the scope to eagerly loaded ancestors/descendants
relationships.

There are numerous tickets indicating this problem. This PR fixes those issues by creating a new v5 with support for Laravel 5.7 and Laravel 5.8 (because of the possible BC towards lower versions).

I took a couple of liberties (upgraded PHPUnit and the minimum PHP version). The unit tests pass again on Laravel 5.7 and up.

Let me know if you would require more info on the topic.

Best regards,

Ciaro

Ciaro added 3 commits April 12, 2019 21:08
Due to some changes in the Laravel internals in regard with handling
eager loading, upgrading the library to Laravel 5.7 is required. Also,
nobody should be on PHP < 7 anyway. So now is a good time, if any...
…zychaser#339, lazychaser#351, lazychaser#329, lazychaser#334, lazychaser#271)

The way eager loading is handled in Laravel has changed since the
original implementation of the NestedSet library. It was not possible
anymore to apply the scope to eagerly loaded ancestors/descendants
relationships.

Also removed defaultOrder() from the relations so custom orders can be
applied. Sorting should never be a part of a relation anyway, or it
would be hard to customize.
@Ciaro Ciaro changed the title V5 - fix support for Laravel 5.7 and 5.8 (fixes #339, #351, #329, #334, #271) V5 - fix support for Laravel 5.7 and 5.8 (fixes #339, #351, #329, #334, #271, #365) Apr 21, 2019
@jsdecena
Copy link

Is this abandoned package? Any fork who applied this PR?

@lazychaser lazychaser merged commit 086807a into lazychaser:v4 Jun 16, 2019
@Ciaro
Copy link
Contributor Author

Ciaro commented Jul 12, 2019

Thank you for the merge, @lazychaser

However, I do believe you will need to make a new version tag (v5).

@lazychaser
Copy link
Owner

why v5?

@Ciaro
Copy link
Contributor Author

Ciaro commented Jul 15, 2019

As described in the PR:

This PR fixes eager loading issues by creating a new v5 with support for Laravel 5.7 and Laravel 5.8 (because of the possible BC towards lower versions).

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

Successfully merging this pull request may close these issues.

3 participants