I have an Event model, that has EventDates An EventDate has a from and to field. In my dashboard, if an event spans multiple days, I need to show a row for each day that event exists. I'm wondering if this behaviour is possible using MySQL only.
Here's some example data
+----+------------+------------+
| id | from | to |
+----+------------+------------+
| 1 | 09-20-2019 | 09-25-2019 |
+----+------------+------------+
I'm wondering if it's possible to create a row for each date in the range, using only MySQL? I'm using Laravel, and I could load all the results and group them, but if it's possible using MySQL only that seems like good practice.
+----+------------+
| id | date |
+----+------------+
| 1 | 09-20-2019 |
| 1 | 09-21-2019 |
| 1 | 09-22-2019 |
| 1 | 09-23-2019 |
| 1 | 09-24-2019 |
| 1 | 09-25-2019 |
+----+------------+