3
0
mirror of https://github.com/snipe/snipe-it.git synced 2026-03-29 20:04:21 +00:00

Put old setter back because reasons?

This commit is contained in:
snipe
2025-10-03 14:46:32 +01:00
parent d7bf9b7f2e
commit 013c50607a

View File

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