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:
@ -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(
|
||||
|
||||
Reference in New Issue
Block a user