i have a user
and a profile
model that every user hasOne
profile .
on some pages i wanted to check the profile of user field like below :
$user->profile->membership_id
now my application crashes when the ->profile
does not exists i can use null coalesce the membership_id
but i want to know if its possible to null safe the ->profile
so if profile does not exists the application wont give error like below :
trying to get membership_id of none object