Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ketconma's avatar

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!!!!

0 likes
1 reply

Please or to participate in this conversation.