public function getFeatureByCode($code)
    {
        $feature = $this->features()->getEager()->first(function($item) use ($code) {
            return $item->code === $code;
        });

        if (is_null($feature)) {
            throw new InvalidPlanFeatureException($code);
        }

        return $feature;
    }
public function getFeatureByCode($code)
    {
        $feature = $this->features()->getEager()->first(function($item) use ($code) {
            return $item->code === $code;
        });

        if (is_null($feature)) {
            throw new InvalidPlanFeatureException($code);
        }

        return $feature;
    }
public function getFeatureByCode ( $ code ) { $ feature = $ this -> features ( ) -> getEager ( ) -> first ( function ( $ item ) use ( $ code ) { return $ item -> code === $ code ; } ) ; if ( is_null ( $ feature ) ) { throw new InvalidPlanFeatureException ( $ code ) ; } return $ feature ; }
Returns the demanded feature

@param String $code
@return PlanFeature
@throws InvalidPlanFeatureException
Returns the demanded feature