Hi @catalyph you could simply use faker to generate a random number of minutes, between 5 and 11 hours worth then simply add those minutes to the start time to use as your finish time.
Factory work shift generation
I cannot figure out how to create a datetime field in factory that the endtime datetime entry is within 12 hours of the starttime entry>
I have tried with Carbon and with faker
neither I can get to work properly.
I want to generate a fake date time entry YYYY-MM-DD HH:mm and then based off that I want another datetime entry that is a random number of hours and minutes added and an entry that shows the difference for example
2024-05-20 08:00 - 2024-05-20 15:20 - (9 hours 20 minute)
2024-05-20 20:00 - 2024-05-21 03:45 - (7 hours 45 minute)
to represent workers shift times. My Database has a start_time and end_time column
Please or to participate in this conversation.