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 10
10
use App \Exceptions \UnverifiedUserException ;
11
11
use App \Livewire \Traits \WithAuthenticatedUser ;
12
12
use App \Models \Article ;
13
+ use Carbon \Carbon ;
13
14
use Filament \Forms ;
14
15
use Filament \Forms \Concerns \InteractsWithForms ;
15
16
use Filament \Forms \Contracts \HasForms ;
@@ -173,8 +174,10 @@ public function save(): void
173
174
$ state = $ this ->form ->getState ();
174
175
175
176
$ 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 (),
178
181
];
179
182
180
183
if ($ this ->article ?->id) {
You can’t perform that action at this time.
0 commit comments