src/FactoryBuilder.php
/**
     * Make an instance of the model with the given attributes.
     *
     * @param  array  $attributes
     * @return mixed
     *
     * @throws \InvalidArgumentException
     */
Make an instance of the model with the given attributes.
@param  array  $attributes
@return mixed


Make an instance of the model with the given attributes . @param array $attributes @return mixed
protected function makeInstance(array $attributes = [])
    {
        if (! isset($this->definitions[$this->class][$this->name])) {
            throw new InvalidArgumentException("Unable to locate factory with name [{$this->name}] [{$this->class}].");
        }
        $entityWrapper = $this->entityFactory->make($this->getMapper()->newInstance());
        $definition = call_user_func(
            $this->definitions[$this->class][$this->name], 
            $this->faker, $attributes);
        $entityWrapper->setEntityAttributes(array_merge($this->applyStates($definition, $attributes), $attributes));
        return $entityWrapper->unwrap();
    }
protected function makeInstance ( array $ attributes = [ ] ) { if ( ! isset ( $ this -> definitions [ $ this -> class ] [ $ this -> name ] ) ) { throw new InvalidArgumentException ( " Unable to locate factory with name [ { $ this -> name } ] [ { $ this -> class } ]. " ) ; } $ entityWrapper = $ this -> entityFactory -> make ( $ this -> getMapper ( ) -> newInstance ( ) ) ; $ definition = call_user_func ( $ this -> definitions [ $ this -> class ] [ $ this -> name ] , $ this -> faker , $ attributes ) ; $ entityWrapper -> setEntityAttributes ( array_merge ( $ this -> applyStates ( $ definition , $ attributes ) , $ attributes ) ) ; return $ entityWrapper -> unwrap ( ) ; }
Make an instance of the model with the given attributes.
Make an instance of the model with the given attributes .