protected function gPercent() { $percent = 0; if ($this->hasRanks()) { $percent = $this->value / $this->rankCollection->last()->threshold * 100; } return $percent > 100 ? 100 : $percent; }