Check single isset
Checking single isset with blade directive
@isset($user->username) <p>{{ $user->username }}</p> @endisset
Checking Multiple isset
To check multiple isset with blade directive you can define it like below. Do note that this isset is check with AND and not an OR.
@isset($user->username, $user->gender) {{ $user->username }} {{ $user->gender }} @endisset
To check if the value is set to only one of the values, you still have to use the if directive.
@if(isset($user->username) || isset($user->gender)) {{ $user->username }} {{ $user->gender }} @endif
Leave a reply