From de7c503cfe2a4ec963515b999c3b1c5b97a1f59e Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Sat, 15 Jan 2022 14:14:26 +0100 Subject: [PATCH] app/Http/Livewire/Form/CardForm.php: Adding getSubjectProperty() --- app/Http/Livewire/Form/CardForm.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/Http/Livewire/Form/CardForm.php b/app/Http/Livewire/Form/CardForm.php index 186db8d..a92eca0 100644 --- a/app/Http/Livewire/Form/CardForm.php +++ b/app/Http/Livewire/Form/CardForm.php @@ -57,4 +57,14 @@ class CardForm extends ModelForm $this->validateOnly($property); } + + public function getSubjectProperty() + { + if ($this->record->character_id) { + return $this->characters[$this->record->character_id]; + } else if ($this->record->class) { + return $this->classes[$this->record->class]; + } + return "Somebody"; + } }