is it possible to check for null values in an object in Laravel? I want to check if a user has completed their profile when they hit an api endpoint so that I can let them know they need to complete their profile if there is a field with null values.
This is how the user object will look like
id: 8,
name: "Jim Jam",
username: "jimjam@test.com",
email_verified_at: null,
dob: null,
sex: null,
nationality: null,
address: null,
state: null,
country: null,
phone: null,
created_at: "2019-08-03 21:10:20",
updated_at: "2019-08-03 21:10:20",
}
Tried this is_null($user->sex || $user->phone)
but it returned false.
What are the possible ways to check if a field is null?