public function isOwnerOfTeam($team) { $team_id = $this->retrieveTeamId($team); return $this->teams()->where('owner_id', $this->getKey())->where('team_id', $team_id)->first() ? true : false; }