Laravel Blade Inline if else-if Statement

Laravel Blade Inline if else-if Statement

Programming requires the use of the if-else and switch case statements in order to evaluate conditions. No matter where we go—a game, a code, or a route for travel—we are constantly looking for shortcuts.

In nested ternary operators, the placement of the parenthesis is important. Essentially, you must enclose whatever you're nesting in parenthesis if you wish to nest a ternary operator in an already-existing ternary operator.

{{$variable == 'Hi' ? 'Hello' : ($var == 'bye' ? 'Goodbye' : 'another option')}}

Read more