When deleting an Address change active to FALSE
This commit is contained in:
@@ -46,6 +46,19 @@ class Address extends Model
|
||||
public const NODE_POINT = 1<<8; // Point
|
||||
public const NODE_UNKNOWN = 1<<15; // Unknown
|
||||
|
||||
public static function boot()
|
||||
{
|
||||
parent::boot();
|
||||
|
||||
// For indexes when deleting, we need to change active to FALSE
|
||||
static::softDeleted(function($model) {
|
||||
Log::debug(sprintf('%s:Deleting [%d], updating active to FALSE',self::LOGKEY,$model->id));
|
||||
|
||||
$model->active = FALSE;
|
||||
$model->save();
|
||||
});
|
||||
}
|
||||
|
||||
/* SCOPES */
|
||||
|
||||
public function scopeFTNOrder($query)
|
||||
|
Reference in New Issue
Block a user