Repository: laravel-shift/blueprint (language: php)

Issue:
Model definition using string generates faker words which are too long
- Laravel Version: #.#.#
- PHP Version: 7.4.15
- Blueprint Version: "laravel-shift/blueprint": "^1.22"
- Platform: Windows
- Faker version: "fakerphp/faker": "^1.9.1"

### Issue:
When using pretty short string field definitions, below 8, the seeding fails due to "Database field length exceeded".
I guess this is because the generated factory request creation of faker "word"
`'tag' => $this->faker->word`
in case "string" type was defined in Blueprint.

It would be helpful to have the factory generated in a way which respects the maxLength of the database field.

### draft.yaml:
```yaml
models:
  Post:
    tag: string:3
```



Discussion / hints:

Fix patch:
diff --git a/src/Generators/FactoryGenerator.php b/src/Generators/FactoryGenerator.php
index 69655711..eadbd75b 100644
--- a/src/Generators/FactoryGenerator.php
+++ b/src/Generators/FactoryGenerator.php
@@ -245,6 +245,10 @@ protected function buildDefinition(Model $model)
                     $faker = 'word';
                 }
 
+                if (($faker === 'word') && (!empty($column->attributes()))) {
+                    $faker = sprintf("regexify('[A-Za-z0-9]{%s}')", current($column->attributes()));
+                }
+
                 if (Blueprint::isLaravel8OrHigher()) {
                     $definition .= '$this->faker->' . $faker;
                 } else {


Test patch:
diff --git a/tests/fixtures/drafts/phone.yaml b/tests/fixtures/drafts/phone.yaml
index 3970b0b7..4d065cdd 100644
--- a/tests/fixtures/drafts/phone.yaml
+++ b/tests/fixtures/drafts/phone.yaml
@@ -6,4 +6,5 @@ models:
     type: enum:home,cell
     status: set:archived,deleted
     foo: morphs
-    bar: morphs nullable
\ No newline at end of file
+    bar: morphs nullable
+    tag: string:3
\ No newline at end of file
diff --git a/tests/fixtures/factories/phone-laravel8.php b/tests/fixtures/factories/phone-laravel8.php
index f93698d3..f60ef433 100644
--- a/tests/fixtures/factories/phone-laravel8.php
+++ b/tests/fixtures/factories/phone-laravel8.php
@@ -31,6 +31,7 @@ public function definition()
             'status' => $this->faker->randomElement(["archived","deleted"]),
             'foo_id' => $this->faker->randomDigitNotNull,
             'foo_type' => $this->faker->word,
+            'tag' => $this->faker->regexify('[A-Za-z0-9]{3}'),
         ];
     }
 }
diff --git a/tests/fixtures/factories/phone.php b/tests/fixtures/factories/phone.php
index 2fabb31e..1a9102b3 100644
--- a/tests/fixtures/factories/phone.php
+++ b/tests/fixtures/factories/phone.php
@@ -14,5 +14,6 @@
         'status' => $faker->randomElement(["archived","deleted"]),
         'foo_id' => $faker->randomDigitNotNull,
         'foo_type' => $faker->word,
+        'tag' => $faker->regexify('[A-Za-z0-9]{3}'),
     ];
 });