I have a quick question. I have a model that I gotta get rid off. I have tried something like the following, but I get an error called Call to a member function delete() on array:
This is what I have tried so far.
$foundTeams = UserHasTeam::find()->where(['user_has_team.user_iduser' => $model->id])->all();
$foundTeams->delete();