laravel inline if else if code example
Example 1: laravel inline if
{{ $var == "hello" ? "Hi" : "Goodbye" }}
Example 2: laravel inline if else if
{{$var == 'hello' ? 'Hi' : ($var == 'bye' ? 'Goodbye' : 'another option')}}
{{ $var == "hello" ? "Hi" : "Goodbye" }}
{{$var == 'hello' ? 'Hi' : ($var == 'bye' ? 'Goodbye' : 'another option')}}