Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[5.2] Add when method to EloquentBuilder#13726

Merged
taylorotwell merged 1 commit into
laravel:5.2from
n7olkachev:5.2
May 26, 2016
Merged

[5.2] Add when method to EloquentBuilder#13726
taylorotwell merged 1 commit into
laravel:5.2from
n7olkachev:5.2

Conversation

@n7olkachev
Copy link
Copy Markdown
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
Copy Markdown
Member

Does falling back to the query builder one not work?

@phroggyy
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

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

@phroggyy
Copy link
Copy Markdown
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
Copy Markdown
Member

Sure 

On Fri, May 27, 2016 at 4:39 PM -0700, "Leo Sjöberg" [email protected] 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.

4 participants