How to set the default date using Laravel Nova

There are multiple methods, but this works:

Date::make('Due At')->withMeta(['value' => $this->due_at ?? Carbon::now()->addDays(2)->toDateString()])->hideFromIndex()->hideFromDetail(),
Date::make('Due At')->hideWhenCreating(),

Share this article

Leave a Reply

Your email address will not be published.

Scroll to Top