laravel/framework — pull request #3100 by Youpie (2014-01-01 22:36:00+00:00)
Title: Run totallyGuarded() once outside of loop.

The boolean returned by totallyGuarded() will never change during the loop. Running the method outside of the foreach avoids one unnecessary count() and two checks for each iteration.