Skip to content

Commit 6e067f2

Browse files
committed
wip
1 parent 085c45f commit 6e067f2

File tree

2 files changed

+51
-48
lines changed

2 files changed

+51
-48
lines changed

app/Filament/Guests/Pages/Mason.php

+5-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class Mason extends Page
2525
public function mount(): void
2626
{
2727
$this->post = MasonModel::first();
28-
$this->form->fill($this->post->toArray());
28+
$this->form->fill($this->post?->toArray() ?? []);
2929
}
3030

3131
public function form(Form $form): Form
@@ -42,7 +42,10 @@ public function form(Form $form): Form
4242

4343
public function store()
4444
{
45-
$this->post->update($this->form->getState());
45+
$data = $this->form->getState();
46+
if ($data !== null) {
47+
$this->post->update($data);
48+
}
4649

4750
Notification::make()
4851
->title('Saved successfully')

composer.lock

+46-46
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)