DrawMyAttention\ResourceGenerator\Commands\ResourceMakeCommand::createModelFactory PHP Method

createModelFactory() private method

private createModelFactory ( $name )
    private function createModelFactory($name)
    {
        $model = $this->modelName($name);
        $stub = $this->files->get(__DIR__ . '/../Stubs/factory.stub');
        $stub = str_replace('CLASSNAME', $model, $stub);
        $class = 'App\\' . $model;
        $model = new $class();
        $stub = str_replace('ATTRIBUTES', $this->buildFakerAttributes($model->migrationAttributes()), $stub);
        $this->files->append(database_path('factories/ModelFactory.php'), $stub);
        $this->info('Created model factory');
        return true;
    }