Skip to content

Commit

Permalink
user update fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Cihan Şentürk committed Jun 24, 2020
1 parent 867fe99 commit a72b422
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/Models/Auth/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ public static function boot()
static::retrieved(function($model) {
$model->setCompanyIds();
});

static::saving(function($model) {
$model->unsetCompanyIds();
});
}

public function companies()
Expand Down Expand Up @@ -194,4 +198,9 @@ public function setCompanyIds()

$this->setAttribute('company_ids', $company_ids);
}

public function unsetCompanyIds()
{
$this->offsetUnset('company_ids');
}
}

0 comments on commit a72b422

Please sign in to comment.