Level 1
Aug 8, 2023
1
Level 1
Nova Date Field within Repeater Field error, pls help
I am using a Date Field within a Repeater Field, and there are no issues with displaying it. I am able to save it without any problem. However, when it comes to displaying it again, there is an error. error: Date field must cast to 'date' in Eloquent model.
return [
Repeater::make('achievement')
->repeatables([
AchievementItem::make()
]),
];
class AchievementItem extends Repeatable
{
public function fields(NovaRequest $request)
{
return [
Date::make( 'from')
];
}
}
data in database:
[
{
"type": "achievement-item",
"fields": {
"from": "2023-08-01"
}
}
]
sorry for my enhlish!!!!
Please or to participate in this conversation.