scadh
scadh

Reputation: 95

Laravel Nova Date field always submits null

A Date field in one of my Nova resources always submits null, even when a date value has been selected from the picker. DateTime works fine. Snippets from pertinent code below:

MIGRATION

$table->date('shipment_date');

MODEL

protected $fillable = [
    'shipment_date',
    *... other fields*
];

protected $casts = [
    'shipment_date' => 'date',
];

RESOURCE

Date::make('Shipment Date', 'shipment_date')
    ->rules([
        'required',
    ])

Upon submitting the form, the field is highlight with red error text: "The Shipment Date field is required". It returns http status 422.

Viewing the request payload in Telescope:

{
"shipment_date": null,
*... other fields*
}

Upvotes: 0

Views: 752

Answers (1)

scadh
scadh

Reputation: 95

This was a bug in Nova and was fixed by the developers in version 3.9.3 released Sept 14 2020. See details here: https://github.com/laravel/nova-issues/issues/2853

Upvotes: 1

Related Questions