I have a Laravel Fluent query that looks like the following:
$query = DB::connection('mysql_users')->table('users_info');
$exists = $query->where('email', '=', $user->email)-first();
if(is_object($exists)) {
// update email
}
else {
// insert email
}
The problem is, sometimes $exists is not an object even though the row does exist. I've also tried with is_null() and have had the same issue. What is the correct way to do this check?