ventaquil ventaquil - 2 months ago 58
PHP Question

Switch in Laravel 5 - Blade

How can I use switch in blade templates? When I used:

`E-mail` input is empty!
`Password` input is empty!

in result I see this text as plaintext. I prefer to use switch in few piece of code because it's more clean for me than when I using if.

But if it's not possible just write it.


Unfortunately Laravel Blade does not have switch statement. You can use Laravel if else approach or use use plain PHP switch. You can use plain PHP in blade templates like in any other PHP application.