protected function isParent(Permission $parent) { $aLen = count(explode('.', $this->name)); $bLen = count(explode('.', $parent->name)); return $aLen - 1 == $bLen ?: false; }