-- Basic Blade Ternary Operator
{{ Auth::check() ? 'yes' : 'no' }}
-- Blade Ternary Operator which checks if user has a stored profile image stored in the database
{{ Auth::user()->profile_image_url == true ? asset(Auth::user()->profile_image_url) : url('/img/NoPhoto.png') }}
- Laravel blade ternary operator
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.