Inani El Houssain created a switch Blade directive. It's a good primer if you want to learn how to create Blade directives yourself.

One of the good points of Laravel’s framework is that it allows you to make your own components, macros and directives. so today we will make use of Laravel’s Custom Blade directives and make something good.

https://medium.com/@InaniT0/build-your-own-switch-statment-using-laravels-custom-blade-directives-218244e41a7c