Closed joelvh closed 2 years ago
Good spot! Haven't run into a scenario where I needed to change the default date class but I'd like to add support for this.
The PHP 7.4 test are failing, should it rather be get_class(now())
instead of dynamic class name access? (Haven't tried it out yet)
@romanzipp good catch - updated it to php 7 syntax
Awesome, thanks!
We use
Date::use(\Carbon\CarbonImmutable::class)
and that makesnow()
and casting useCarbonImmutable
. It's not clear how to get the class from theDate
facade, so we get it by usingnow()
.Laravel provides this feature to customize the date class, but virtually all phpdoc generators don't realize
Carbon
isn't always the date class.