mirror of
https://github.com/snipe/snipe-it.git
synced 2026-02-05 10:45:24 +00:00
Added normalization midddleware, removed
This commit is contained in:
@ -23,6 +23,7 @@ class Kernel extends HttpKernel
|
||||
\App\Http\Middleware\CheckForSetup::class,
|
||||
\Fideloper\Proxy\TrustProxies::class,
|
||||
\App\Http\Middleware\CheckForDebug::class,
|
||||
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
@ -8,15 +8,6 @@ use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class SnipeModel extends Model
|
||||
{
|
||||
// Setters that are appropriate across multiple models.
|
||||
public function setPurchaseDateAttribute($value)
|
||||
{
|
||||
if ($value == '') {
|
||||
$value = null;
|
||||
}
|
||||
$this->attributes['purchase_date'] = $value;
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $value
|
||||
@ -31,69 +22,6 @@ class SnipeModel extends Model
|
||||
return;
|
||||
}
|
||||
|
||||
public function setLocationIdAttribute($value)
|
||||
{
|
||||
if ($value == '') {
|
||||
$value = null;
|
||||
}
|
||||
$this->attributes['location_id'] = $value;
|
||||
return;
|
||||
}
|
||||
|
||||
public function setCategoryIdAttribute($value)
|
||||
{
|
||||
if ($value == '') {
|
||||
$value = null;
|
||||
}
|
||||
$this->attributes['category_id'] = $value;
|
||||
// dd($this->attributes);
|
||||
return;
|
||||
}
|
||||
|
||||
public function setSupplierIdAttribute($value)
|
||||
{
|
||||
if ($value == '') {
|
||||
$value = null;
|
||||
}
|
||||
$this->attributes['supplier_id'] = $value;
|
||||
return;
|
||||
}
|
||||
|
||||
public function setDepreciationIdAttribute($value)
|
||||
{
|
||||
if ($value == '') {
|
||||
$value = null;
|
||||
}
|
||||
$this->attributes['depreciation_id'] = $value;
|
||||
return;
|
||||
}
|
||||
|
||||
public function setManufacturerIdAttribute($value)
|
||||
{
|
||||
if ($value == '') {
|
||||
$value = null;
|
||||
}
|
||||
$this->attributes['manufacturer_id'] = $value;
|
||||
return;
|
||||
}
|
||||
|
||||
public function setMinAmtAttribute($value)
|
||||
{
|
||||
if ($value == '') {
|
||||
$value = null;
|
||||
}
|
||||
$this->attributes['min_amt'] = $value;
|
||||
return;
|
||||
}
|
||||
|
||||
public function setParentIdAttribute($value)
|
||||
{
|
||||
if ($value == '') {
|
||||
$value = null;
|
||||
}
|
||||
$this->attributes['parent_id'] = $value;
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
public function getDisplayNameAttribute()
|
||||
|
||||
Reference in New Issue
Block a user