Skip to content

Commit 925d056

Browse files
committed
fix: LAR-188 fixing article created.
1 parent c86b72a commit 925d056

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

app/Livewire/Components/Slideovers/ArticleForm.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use App\Exceptions\UnverifiedUserException;
1111
use App\Livewire\Traits\WithAuthenticatedUser;
1212
use App\Models\Article;
13+
use Carbon\Carbon;
1314
use Filament\Forms;
1415
use Filament\Forms\Concerns\InteractsWithForms;
1516
use 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) {

0 commit comments

Comments
 (0)