Yii2 Trying to get property of non-object – PHP
I'm trying to get data from a model. $profile = Profile::findOne(['user_id'=>$appointment->user_id]); $diabetes = $profile->diabetes; I get an error Trying to get property 'diabetes' of non-object. Tried to check the availability of data through: $profile->getAttributes(['diabetes']) Data present! But I can't use…