I need to retrieve the "end_time" column value from the previous id
Not sure to understand why, can you explain?
Hi. I trying to build a dynamic event timetable, using laravel 4.2 and CRUD. The table has basically
| id | start_time | duration | end_time | performer |
|----|------------|----------|----------|-----------|
| 1 | 9:00 | +15 minutes | 9:15 | Performer A |
After some research, I found a way to retrieve the id, which is commonly used in paginations, I think. Here is the code:
$previous = Time::where('id', '<', $time->id)->max('id');
But in my case, I need to retrieve the "end_time" column value from the previous id into my CREATE view page, to know the next start_time and than input the "duration" . The end_time is filled dynamically by adding the duration time with the start_time.
Appreciate any help!
Maybe you can something like this
$previous = User::where('id', '<', $user->id)->orderby('id', 'desc')->first();
Please or to participate in this conversation.