laravel-shift / blueprint

A code generation tool for Laravel developers.
MIT License
2.86k stars 273 forks source link

Wrong faker for string column type with max chars #683

Closed myregistration closed 7 months ago

myregistration commented 7 months ago

Issue:

Should a string column with max 50 characters create a faker with 'title' => $this->faker->sentence(4),? It seems like all the strings do this. Thanks!

draft.yaml:

  PetType:
    title: string:50
jasonmccreary commented 7 months ago

It's possible this fake value could be over 50 characters. However, it would simply be truncated by the database. The factories Blueprint produces are "guessed". As such, they may not be perfect values for your application. You are always encouraged to tweak them for your needs.