Reputation: 29
and I want to show all data in table Transaction using Laravel I'm using index.blade.php
into Table
so, when someone makes a transaction, I give them 30 mins. example startTime= 2020-04-26 21:04:00
endTime should be= 2020-04-26 21:34:00
so when current time= 2020-04-26 21:24:00, that row will change to yellow
when
current time= 2020-04-26 21:32:00````, that row will change to red
What should I do?
this is my index
this is my transaction.php
this is my transactionController@index
this is my transactionControlelr@store
this is my create table transaction
Upvotes: 0
Views: 708
Reputation: 15047
If you want to add 30 min to some time just do this:
[
startTime => date('Y-m-d H:i:s'),
endTime => date('Y-m-d H:i:s', strtotime('+30 minutes'))
]
If you need to add 30min to some specific datetime, then use this:
$specificDateTime = '2020-04-26 21:32:00';
$increased = date('Y-m-d H:i:s', strtotime($created_at . '+30 minutes'));
Upvotes: 1