DateTime Error when using 'Spatie Settings' plugin
I'm getting this error when I try to edit the settings for my site
Object of class DateTime could not be converted to string
- Using https://filamentphp.com/plugins/filament-spatie-settings
ManageCompetitions.php
page
CompetitionSettings.php
page
15 Replies
What is the actual error?

Would need to see the stack trace, but my guess is that the filament fields are expecting a Carbon instance instead.
Here's the stack trace - I'll switch it to a carbon instance and see if it fixes it.
I switched the typehint to
Carbon\Carbon
which allowed the page to load, but it's erroring on save now.Hmm, sorry, don’t have a lot of experience with the spatie’s package. But definitely a type cast mismatch happening somewhere.
Do you have a repo you could share?
Try CabonInterface in stead of Carbon.
In the CompetitionSettings class
but this might be in the spatie settings, let me see if I can fix it

Hmm, yea. Tough to say, since i don’t have more experience with the spatie package. Sorry.
No worries, Thank you for the help!
Definitely think it’s a casting issue though. Just not sure where it’s conflicting. Don’t think it’s a filament issue though.
Agreed, definitely don't think it's a filament issue. Just not sure how to fix it
I'll open an issue with Spatie!
My advice would be to try dd’ing along the stack trace to see where it’s failing specifically.
Oh great idea, Thank you!