File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
app/Livewire/Components/Slideovers Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 1010use App \Exceptions \UnverifiedUserException ;
1111use App \Livewire \Traits \WithAuthenticatedUser ;
1212use App \Models \Article ;
13+ use Carbon \Carbon ;
1314use Filament \Forms ;
1415use Filament \Forms \Concerns \InteractsWithForms ;
1516use Filament \Forms \Contracts \HasForms ;
@@ -173,8 +174,10 @@ public function save(): void
173174 $ state = $ this ->form ->getState ();
174175
175176 $ publishedFields = [
176- 'published_at ' => data_get ($ state , 'published_at ' ) ?? null ,
177- 'submitted_at ' => data_get ($ state , 'is_draft ' ) ?? null ,
177+ 'published_at ' => data_get ($ state , 'published_at ' )
178+ ? new Carbon (data_get ($ state , 'published_at ' ))
179+ : null ,
180+ 'submitted_at ' => data_get ($ state , 'is_draft ' ) ? null : now (),
178181 ];
179182
180183 if ($ this ->article ?->id) {
You can’t perform that action at this time.
0 commit comments