Is there a syntax to specify inline if and else if statement in Laravel blade template?
Normally, the syntaxt for if and else statement would be :
{{ $var === "hello" ? "Hi" : "Goodbye" }}
I would now like to include else if statement, is this possible?
{{ $var === "hello" ? "Hi" : "Goodbye" else if $var ==="howdie ? "how" : "Goodbye""}}
You can use this code in laravel blade:
{{ $var === "hello" ? "Hi" : ($var ==="howdie ? "how" : "Goodbye") }}