pollmelo / backberry

fruity backend for pollmelo
2 stars 0 forks source link

Create fake data for polls and votes #38

Closed emsbe closed 1 year ago

emsbe commented 1 year ago

This PR solves #37 and adds a vote and a poll factory. These factories describe the kind of data needed to create a poll and a vote. The data itself is created with FakePHP.

With the seed command ddev exec php artisan seed 20, 20 polls and a random amount of votes for each poll are created.

martincodes-de commented 1 year ago

We should decrease the textlength of polls -> name. It's too big imo. Maybe a variation with random length would be great.

martincodes-de commented 1 year ago

We should also use some other correct dates in the future to have a bit more realistic dates. After some research, you can use fake()->dateTimeBetween(lowestRange, highestRange) to create some in that range. I would use a range from -1 week from now to +8 weeks from now.