public function hasCage(string $area, int $level = 0, bool $activeOnly = true) : ?Model
    {
        $cages = $activeOnly ? $this->getActiveCages() : $this->allCages;

        foreach ($cages as $index => $cage) {
            if ($cage->area === $area && $cage->level >= $level) {
                return $cage;
            }
        }

        return null;
    }
public function hasCage(string $area, int $level = 0, bool $activeOnly = true) : ?Model
    {
        $cages = $activeOnly ? $this->getActiveCages() : $this->allCages;

        foreach ($cages as $index => $cage) {
            if ($cage->area === $area && $cage->level >= $level) {
                return $cage;
            }
        }

        return null;
    }
public function hasCage ( string $ area , int $ level = 0 , bool $ activeOnly = true ) : ? Model { $ cages = $ activeOnly ? $ this -> getActiveCages ( ) : $ this -> allCages ; foreach ( $ cages as $ index => $ cage ) { if ( $ cage -> area === $ area && $ cage -> level >= $ level ) { return $ cage ; } } return null ; }
Check if user has cage.

@param string $area
@param int    $level
@param bool   $activeOnly    If false, will search through all cages, otherwise will only search active ones
@return \Laranix\Auth\User\Cage\Cage|\Laranix\Support\Database\Model|null
Check if user has cage .