public function getActiveCages() : Collection
    {
        if ($this->activeCagesCollection !== null) {
            return $this->activeCagesCollection;
        }

        $this->activeCagesCollection = new Collection();

        foreach ($this->allCages as $id => $cage) {
            if (!$cage->isExpired() && !$cage->isRemoved()) {
                $this->activeCagesCollection->push($cage);
            }
        }

        return $this->activeCagesCollection;
    }
public function getActiveCages() : Collection
    {
        if ($this->activeCagesCollection !== null) {
            return $this->activeCagesCollection;
        }

        $this->activeCagesCollection = new Collection();

        foreach ($this->allCages as $id => $cage) {
            if (!$cage->isExpired() && !$cage->isRemoved()) {
                $this->activeCagesCollection->push($cage);
            }
        }

        return $this->activeCagesCollection;
    }
public function getActiveCages ( ) : Collection { if ( $ this -> activeCagesCollection !== null ) { return $ this -> activeCagesCollection ; } $ this -> activeCagesCollection = new Collection ( ) ; foreach ( $ this -> allCages as $ id => $ cage ) { if ( ! $ cage -> isExpired ( ) && ! $ cage -> isRemoved ( ) ) { $ this -> activeCagesCollection -> push ( $ cage ) ; } } return $ this -> activeCagesCollection ; }
Get active cages from all cages
This saves a query

@return \Illuminate\Database\Eloquent\Collection
Get active cages from all cages This saves a query