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

[5.5] Add get method in the Relation class #20052

Merged
merged 1 commit into from
Jul 14, 2017

Conversation

sileence
Copy link
Contributor

(Reopened)

This PR is a micro optimisation on one side, but on the other side I think it is good to be explicit here since the BelongsToManyclass is actually "overriding" the (non-declared) get method.

For example I thought I could change this:

    public function getEager()
    {
        return $this->get();
    }

To this:

    public function getEager()
    {
        return $this->query->get();
    }

Since get()was just a call to a "magic method"

But this actually caused 2 tests to fail because get is (re)declared in BelongsToMany.

@taylorotwell taylorotwell merged commit c472254 into laravel:master Jul 14, 2017
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.

None yet

2 participants