From 860be2c52b63b7f3e6abf70bddaa55e5f5517b3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9as=20Lundgren?= Date: Mon, 25 Nov 2024 11:00:48 +0100 Subject: [PATCH] Fix fallbacks to actually work... --- packages/admin/src/Models/Staff.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/admin/src/Models/Staff.php b/packages/admin/src/Models/Staff.php index 8e75f58bf..28689d517 100644 --- a/packages/admin/src/Models/Staff.php +++ b/packages/admin/src/Models/Staff.php @@ -62,19 +62,19 @@ class Staff extends Authenticatable implements FilamentUser, HasName 'full_name', ]; - protected function firstName(): Attribute + protected function firstname(): Attribute { return Attribute::make( - get: fn (): string => $this->first_name, - set: fn (?string $value) => $this->first_name = $value, + get: fn (mixed $value, array $attributes) => $attributes['first_name'], + set: fn (string $value) => ['first_name' => $value], ); } - protected function lastName(): Attribute + protected function lastname(): Attribute { return Attribute::make( - get: fn (): string => $this->last_name, - set: fn (?string $value) => $this->last_name = $value, + get: fn (mixed $value, array $attributes) => $attributes['last_name'], + set: fn (string $value) => ['last_name' => $value], ); }