protected function getStateAttributes($factory, $states, $modelClass)
    {
        return collect($states)
            ->flatMap(function ($state) use ($factory, $modelClass) {
                $stateClosure = call_user_func(
                    \Closure::bind(function () use ($modelClass, $state) {
                        if (!isset($this->states[$modelClass][$state])) {
                            throw new \InvalidArgumentException("Unable to locate [{$state}] state for [{$modelClass}].");
                        }

                        return $this->states[$modelClass][$state];
                    }, $factory, $factory)
                );

                return $stateClosure($this->generator);
            })
            ->all();
    }
protected function getStateAttributes($factory, $states, $modelClass)
    {
        return collect($states)
            ->flatMap(function ($state) use ($factory, $modelClass) {
                $stateClosure = call_user_func(
                    \Closure::bind(function () use ($modelClass, $state) {
                        if (!isset($this->states[$modelClass][$state])) {
                            throw new \InvalidArgumentException("Unable to locate [{$state}] state for [{$modelClass}].");
                        }

                        return $this->states[$modelClass][$state];
                    }, $factory, $factory)
                );

                return $stateClosure($this->generator);
            })
            ->all();
    }
protected function getStateAttributes ( $ factory , $ states , $ modelClass ) { return collect ( $ states ) -> flatMap ( function ( $ state ) use ( $ factory , $ modelClass ) { $ stateClosure = call_user_func ( \ Closure :: bind ( function ( ) use ( $ modelClass , $ state ) { if ( ! isset ( $ this -> states [ $ modelClass ] [ $ state ] ) ) { throw new \ InvalidArgumentException ( "Unable to locate [{$state}] state for [{$modelClass}]." ) ; } return $ this -> states [ $ modelClass ] [ $ state ] ; } , $ factory , $ factory ) ) ; return $ stateClosure ( $ this -> generator ) ; } ) -> all ( ) ; }
Get the factory state attributes of the model being built.

@param  Eloquent\Factory $factory
@param  string[]         $states
@param  string           $modelClass
@return array
@throws \InvalidArgumentException
Get the factory state attributes of the model being built .