Skip to content

Instantly share code, notes, and snippets.

@ElliottLandsborough
Created September 20, 2017 14:38
Show Gist options
  • Select an option

  • Save ElliottLandsborough/09678e23c123768faac3db6195fa34d8 to your computer and use it in GitHub Desktop.

Select an option

Save ElliottLandsborough/09678e23c123768faac3db6195fa34d8 to your computer and use it in GitHub Desktop.
Laravel blade @break and @continue
<?php
namespace App\Providers;
use Illuminate\Http\Request;
use Illuminate\Support\ServiceProvider;
use Blade;
class AppServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot(Request $request)
{
Blade::directive('break', function($expression) {
return "<?php break; ?>";
});
Blade::directive('continue', function($expression) {
return "<?php continue; ?>";
});
}
/**
* Register any application services.
*
* @return void
*/
public function register()
{
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment