These are the values on my database, I just need to get the remaining days of each today:
{{ \Carbon\Carbon::now()->diffInDays($patient->date_end) }}
the problem solved but , im confused with the may 7 , which is the 3rd row should give me a negative value
If you want to get the negative values, you would need to pass false
as the second parameter of the diffInDays
function.
Carbon\Carbon::now()->diffInDays($patient->date_end, false)
The second parameter sets whether you want the absolute difference or not. Default is true, which returns absolute difference.