I want to add the following code to my laravel project to support the break and continue statements in blade.
This is the code:
Blade::extend(functio
There's no requirement telling you where you should put the code, you could even put it in your routes.php
(which is a bit messy of course). You only have to make sure that it's loaded when laravel processes a page view.
In this case, creating a new file blade_extensions.php
somewhere and including it in start/global.php
might be a good solution.
PS: Be sure to clear out your compiled views, as Blade only recompiles the views if it detects a change, so if you've just plonked in this code it won't work until you clear out the views.