Skip to content

A free open source IT asset/license management system

Put old setter back because reasons?

snipe013c50607aaf
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(