cable8mm/xeed

Factory varchar produces fake()->paragraph() which is too long

akulmehta opened this issue · 3 comments

Firstly, thank you for this package - it has been a lifesaver.

When using xeed to produce factories, it converts existing varchar columns to fake()->paragraph() in file src/Resolvers/VarcharResolver.php. However, since the default paragraph() is 3 sentences long, often times this is too long for the varchar column. It would be great if the package can read the limit of the columns and use fake()->text() instead.

I'm sorry to reply lately. I am going to check your opinion then reply soon.

@akulmehta can download right now, because this package has been updated to v1.5.0.

I think the issue still exists for columns where the varchar column is less than 20 characters for example. By default fake()->text() generates a longer string than 20 characters. I think you may want to check what the varchar limit of the column is and use that as a parameter for fake()->text(). I am not sure where in the codebase xeed checks the columns, but an additional check of column length would help in producing text which fits better in such smaller columns. Let me know if I should create a new issue for this.