From 0915de8f8b8cdc90e3d397ddc0e52bc1978c0d21 Mon Sep 17 00:00:00 2001 From: philipp lang Date: Sun, 20 Oct 2024 21:40:16 +0200 Subject: [PATCH] Update update hook --- modules/Mailgateway/Components/Form.php | 6 ++---- modules/Mailgateway/Components/setting-view.blade.php | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/modules/Mailgateway/Components/Form.php b/modules/Mailgateway/Components/Form.php index 650da197..1dda7427 100644 --- a/modules/Mailgateway/Components/Form.php +++ b/modules/Mailgateway/Components/Form.php @@ -42,16 +42,14 @@ class Form extends Component ]; } - public function mount(?string $model = null): void + public function mount(?Mailgateway $model = null): void { $this->types = app('mail-gateways')->map(fn ($gateway) => [ 'name' => $gateway::name(), 'id' => $gateway, ]); - $model = Mailgateway::find($model); - - if ($model) { + if ($model->getRouteKey()) { $this->id = $model->id; $this->name = $model->name; $this->domain = $model->domain; diff --git a/modules/Mailgateway/Components/setting-view.blade.php b/modules/Mailgateway/Components/setting-view.blade.php index d4b2c45f..3dfcd6cd 100644 --- a/modules/Mailgateway/Components/setting-view.blade.php +++ b/modules/Mailgateway/Components/setting-view.blade.php @@ -9,7 +9,7 @@ Aktion - Neu + Neu @foreach ($data as $index => $gateway)