Repository: laravel-shift/blueprint (php)

Issue:
Incorrect faker provider generated from column defined as "name: enum"
- Laravel Version: 11.1.1
- PHP Version: 8.3.7
- Blueprint Version: 2.10.0
- Platform: Mac

### Issue:
It's possible this is intended behavior, but feels more like a bug?

If I define a model with a column name of `name` and a type `enum`

```yaml
models:
  Post:
    name: enum:one,two,three
```

I would expect the generated factory definition to look like this
```
return [
  'name' => $this->faker->randomElement(["one","two","three"]),
];
```

but instead I get

```
return [
  'name' => $this->faker->name(),
];
```

Looks like the `FactoryGenerator` looks for an implicit match before an explicit one:
https://github.com/laravel-shift/blueprint/blob/4485f6b3491eaeca6c9d59114b5c1dd349f914d0/src/Generators/FactoryGenerator.php#L123


Repro:
```
composer create-project laravel/laravel example-app
cd example-app
composer require -W --dev laravel-shift/blueprint
php artisan blueprint:new
# fill in draft.yaml as above
php artisan blueprint:build
```

As a workaround I can easily change the name of the column, but as-is the generated migration ends up with `$table->enum('name', ["one","two","three"]);`, so if nothing else, the logic seems to differ a bit between the Factory and Migration generators ¯\\\_(ツ)\_/¯

Pull request:
fix: enum in factory
Fixes #691 but ensuring the factory uses a random element instead of a string / name

Patch:
diff --git a/src/Generators/FactoryGenerator.php b/src/Generators/FactoryGenerator.php
index a3d66d0..d4d8433 100644
--- a/src/Generators/FactoryGenerator.php
+++ b/src/Generators/FactoryGenerator.php
@@ -120,7 +120,7 @@ class FactoryGenerator extends AbstractClassGenerator implements Generator
                 $definition .= sprintf('%s::factory()', $class);
                 $definition .= ',' . PHP_EOL;
             } elseif (in_array($column->dataType(), ['enum', 'set']) && !empty($column->attributes())) {
-                $faker = FakerRegistry::fakerData($column->name()) ?? FakerRegistry::fakerDataType($column->dataType());
+                $faker = FakerRegistry::fakerDataType($column->dataType()) ?? FakerRegistry::fakerData($column->name());
                 $definition .= str_repeat(self::INDENT, 3) . "'{$column->name()}' => ";
                 $definition .= '$this->faker->' . $faker;
                 $definition .= ',' . PHP_EOL;


Test patch:
diff --git a/tests/Feature/Generators/FactoryGeneratorTest.php b/tests/Feature/Generators/FactoryGeneratorTest.php
index 43d4289..3ba87e3 100644
--- a/tests/Feature/Generators/FactoryGeneratorTest.php
+++ b/tests/Feature/Generators/FactoryGeneratorTest.php
@@ -166,6 +166,26 @@ final class FactoryGeneratorTest extends TestCase
         $this->assertEquals(['created' => ['database/factories/Admin/UserFactory.php']], $this->subject->output($tree));
     }
 
+    #[Test]
+    public function output_factory_uses_enum(): void
+    {
+        $this->filesystem->expects('stub')
+            ->with($this->factoryStub)
+            ->andReturn($this->stub($this->factoryStub));
+
+        $this->filesystem->expects('exists')
+            ->with('database/factories')
+            ->andReturnTrue();
+
+        $this->filesystem->expects('put')
+            ->with('database/factories/PostFactory.php', $this->fixture('factories/with-enum.php'));
+
+        $tokens = $this->blueprint->parse($this->fixture('drafts/with-enum.yaml'));
+        $tree = $this->blueprint->analyze($tokens);
+
+        $this->assertEquals(['created' => ['database/factories/PostFactory.php']], $this->subject->output($tree));
+    }
+
     public static function modelTreeDataProvider(): array
     {
         return [
diff --git a/tests/fixtures/drafts/with-enum.yaml b/tests/fixtures/drafts/with-enum.yaml
new file mode 100644
index 0000000..84680ce
--- /dev/null
+++ b/tests/fixtures/drafts/with-enum.yaml
@@ -0,0 +1,3 @@
+models:
+  Post:
+    name: enum:one,two,three
\ No newline at end of file
diff --git a/tests/fixtures/factories/with-enum.php b/tests/fixtures/factories/with-enum.php
new file mode 100644
index 0000000..0956f69
--- /dev/null
+++ b/tests/fixtures/factories/with-enum.php
@@ -0,0 +1,27 @@
+<?php
+
+namespace Database\Factories;
+
+use Illuminate\Database\Eloquent\Factories\Factory;
+use Illuminate\Support\Str;
+use App\Models\Post;
+
+class PostFactory extends Factory
+{
+    /**
+     * The name of the factory's corresponding model.
+     *
+     * @var string
+     */
+    protected $model = Post::class;
+
+    /**
+     * Define the model's default state.
+     */
+    public function definition(): array
+    {
+        return [
+            'name' => $this->faker->randomElement(["one","two","three"]),
+        ];
+    }
+}