@if(date('j', strtotime($event->start_from)) == date('j', strtotime($event->start_to)))
<!-- The dates have the same day of the month -->
@endif
The date function takes a format string as the first argument, and a timestamp as the second argument. The 'j' format string returns the day of the month (without leading zeros). The strtotime function converts a date string to a timestamp.
@MichalOravec Would it actually make a difference to use Carbon or not? Just asking, what do you think?
I could not reply to you right away, Laracasts has put a delay in my replies....stuck with replying to people quickly.
@User1980 Yes, he misinterpreted you. I believe he assumed you agreed with the first solution because it was the first, but you agreed with the first because you don't understand why the second is better than the first. And you are asking why the second solution would be better in this case than the first one.