'I want to fetch data from DB "start_time" and "end_time", is there any way to display all time per hour in Laravel?

I want to fetch data from DB "start_time" and "end_time", is there any way to display all time per hour in Laravel?

For example: start_time = 8:00 end_time = 11:00

Sample output:

8:00 9:00 10:00 11:00


Solution 1:[1]

Do you really need to search in database ?

Maybe do this with while in php.

Take the first start_time as 8 (just do like it was not a time)

while 8 < at 11(endtime) { update a array to save value : myArray[i]=myHour . ":00"}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ondrelat