Skip to content

Instantly share code, notes, and snippets.

@sujalpatel2209
sujalpatel2209 / Switch_Case_In_Laravel5.x.txt
Last active July 19, 2017 16:29
Using Switch Case on Laravel 5.x Blade
In this post I will show you about how to add Switch Case to Laravel 5.x blade template engine.
On app/Providers/AppServiceProvider.php do following steps:
use Illuminate\Support\Facades\Blade;
On function function boot() add following line:
// Switch case directive
Blade::extend(function($value, $compiler){