Skip to content

Model definition using string generates faker words which are too long #434

@ffmit

Description

@ffmit
  • 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:

models:
  Post:
    tag: string:3

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpendingThis issue is pending review

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions