public function factory($name)
    {
        if (isset($this->factories[$name])) {
            return $this->factories[$name];
        }

        if (class_exists($class = $this->inflect($name))) {
            return $this->factories[$name] = new $class();
        }

        throw new InvalidArgumentException("Unsupported factory [$name].");
    }
public function factory($name)
    {
        if (isset($this->factories[$name])) {
            return $this->factories[$name];
        }

        if (class_exists($class = $this->inflect($name))) {
            return $this->factories[$name] = new $class();
        }

        throw new InvalidArgumentException("Unsupported factory [$name].");
    }
public function factory ( $ name ) { if ( isset ( $ this -> factories [ $ name ] ) ) { return $ this -> factories [ $ name ] ; } if ( class_exists ( $ class = $ this -> inflect ( $ name ) ) ) { return $ this -> factories [ $ name ] = new $ class ( ) ; } throw new InvalidArgumentException ( "Unsupported factory [$name]." ) ; }
Get a factory instance by name.

@param string $name

@return \NotifyMeHQ\Contracts\FactoryInterface
Get a factory instance by name .