Replies: 2 comments 8 replies
-
Add to your base model a trait, that will override asDateTime() to your desired behavior. But you would be still needed to ad custom fieds to dates array. Of cause you can dynamically resolve all timestamp fields in table, but do you really need this behavior? |
Beta Was this translation helpful? Give feedback.
5 replies
-
You can put \Illuminate\Support\Facades\Date::use(\Carbon\CarbonImmutable::class); In the boot of a service provider |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Eloquent casts only columns named "created_at", "updated_at" to Carbon:
I want all timestamp columns cast to CarbonImmutable by default. How can I do this?
for example:
I know there are $casts, but I don't want to write $casts one by one for each timestamp columns:
Beta Was this translation helpful? Give feedback.
All reactions