protected function gPoints() { $points = 0; $this->cards->filter(function (Card $card) use(&$points) { $points += $card->totalPoints; }); return $points; }