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.2] Add when method to EloquentBuilder #13726

Merged
merged 1 commit into from
May 26, 2016
Merged

[5.2] Add when method to EloquentBuilder #13726

merged 1 commit into from
May 26, 2016

Conversation

n7olkachev
Copy link
Contributor

There is when method in QueryBuilder that can be accessed by __call, but it would be cool if we could use it directly on EloquentBuilder.

@GrahamCampbell GrahamCampbell changed the title Add when method to EloquentBuilder [5.2] Add when method to EloquentBuilder May 26, 2016
@taylorotwell
Copy link
Member

Does falling back to the query builder one not work?

@phroggyy
Copy link
Contributor

@taylorotwell I guess he would like to utilise some Eloquent builder method in the when closure, which can't be done with fallback to Query builder.

@taylorotwell taylorotwell merged commit e31fb1d into laravel:5.2 May 26, 2016
@vlakoff
Copy link
Contributor

vlakoff commented May 26, 2016

So it's about having the proper context. Only looking at the changelog, I nearly felt into the trap. Maybe it would be advisable to add a line of code documentation, so people don't want to remove this "code duplication" later?

@n7olkachev
Copy link
Contributor Author

Agreed. BTW, found that chunk method is also duplicated. Is there any sense of it?

@phroggyy
Copy link
Contributor

@taylorotwell we should really have some simple test here that calls a method on the eloquent builder. That way, if someone comes up with the idea to remove this "duplication", it's easy to see a failing test because it can't call that method. Thoughts? I could put this together over the weekend if @n7olkachev doesn't.

@taylorotwell
Copy link
Member

Sure 

On Fri, May 27, 2016 at 4:39 PM -0700, "Leo Sjöberg" notifications@github.com wrote:

@taylorotwell we should really have some simple test here that calls a method on the eloquent builder. That way, if someone comes up with the idea to remove this "duplication", it's easy to see a failing test because it can't call that method. Thoughts? I could put this together over the weekend if @n7olkachev doesn't.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

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

4 participants