How to easily compare dates with Carbon in Laravel
Hello, friends. Did you know that you don’t have to compare dates yourself to check if it’s in the past or in the future. Use Carbon library methods isFuture and isPast for that:
Hello, friends. Did you know that you don’t have to compare dates yourself to check if it’s in the past or in the future. Use Carbon library methods isFuture and isPast for that:
When you try to parse a date with Carbon, by default it will throw an exception when parsing an invalid date format. So you need to manually try/catch the exception in your code. But sometimes, you might need a false value rather than dealing with the exception. So here is the macro that will help […]