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

Return custom builder if method exists on builder #364

Merged

Conversation

BertvanHoekelen
Copy link
Contributor

@BertvanHoekelen BertvanHoekelen commented Nov 8, 2019

When chaining other query builder methods on custom builder scopes you get: Method Illuminate\Support\Collection::METHOD() invoked with 0 parameters, 1-2 required. or something similar. This PR makes sure that the custom builder is returned when the scope is called.

I also added extra tests: verify Builder is returned for local scopes, verify model is returned for creation/retrieval methods and the default return collection.

@canvural canvural merged commit 91fe64b into larastan:master Nov 8, 2019
@canvural
Copy link
Collaborator

canvural commented Nov 8, 2019

Thank you!

@BertvanHoekelen BertvanHoekelen deleted the return-custom-eloquent-builder branch November 8, 2019 13:57
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