From 013c50607aafafb7d0f4e5db2dd7d3d166c3e69d Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 3 Oct 2025 14:46:32 +0100 Subject: [PATCH] Put old setter back because reasons? --- app/Models/SnipeModel.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/app/Models/SnipeModel.php b/app/Models/SnipeModel.php index b4db5f2c95..b9a1f1c171 100644 --- a/app/Models/SnipeModel.php +++ b/app/Models/SnipeModel.php @@ -12,16 +12,15 @@ use Illuminate\Support\Facades\Request; class SnipeModel extends Model { // Setters that are appropriate across multiple models. - - - protected function purchaseDate(): Attribute + public function setPurchaseDateAttribute($value) { - return Attribute:: make( - set: fn(mixed $value) => $value ?: null, - get: fn(mixed $value) => $value, - ); + if ($value == '') { + $value = null; + } + $this->attributes['purchase_date'] = $value; } + protected function purchaseDateFormatted(): Attribute { return Attribute:: make(