Laravel Blade how to use if statement for null or empty
You can do it as bellow
@if (empty(Auth::user()->age))
// your if code
@else
// your else code
@endif
you can also use:
{{ Auth::user()->age or 'Age not provided' }}
so you will have more clean blade template
This works for me:
{ Auth::user()->age ?: 'Age not provided' }}