laravel/framework — pull request #6844 by maddes (2014-12-29 12:47:14+00:00)
Title: Fix for issue #6116.

Fix for issue #6116.
Currently using an advanced where inside a GlobalScope apply() method creates an enless loop because of the `->applyGlobalScopes()->removeGlobalScopes()` produced with `newQueryWithoutScopes()`.

I've moved some code to prevent this. Nothing new is added, just made sure of calling `->applyGlobalScopes()` only when needed...