I think the problem is with ->format('d-m-Y'). If you are using this format in order to compare just the date without comparing the time, you can use today with carbon:
@manelgavalda and @nakov you were right with my problem. Problem was with data format I changed format to Y-m-d and all is fine but maybe there is a solution to display data in a format d-m-Y? Any ideas?
@sinres you can change the format of the date using the $casts field in the model, but that won't help with the query. So if you just want to display the date in a different format, add this in your model class containing the inspection_date field:
Here is my logic: if you are comparing date then your method should be whereDate and if your comparing complete datetime then your method will be only where: