I'm creating a timeline and I'm nearly finished. I want that the color of the date for each timeline event is the same beside if the date is "today".
So I need something like:
@if($event[$i]->created_at->format('d.m.Y') == *code or variable that says its today*)
....
@endif
But I couldn't figure out what I can do to save the todays date in a variable.. Does anybody knows a solution for this?
thanks!
You can use isToday()
method to check if date is today:
if ($event[$i]->created_at->isToday())
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With