[5.2] Add when method to EloquentBuilder#13726
Conversation
|
Does falling back to the query builder one not work? |
|
@taylorotwell I guess he would like to utilise some Eloquent builder method in the |
|
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? |
|
Agreed. BTW, found that |
|
@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. |
|
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. — |
There is
whenmethod in QueryBuilder that can be accessed by__call, but it would be cool if we could use it directly on EloquentBuilder.