user update fixed
This commit is contained in:
parent
867fe99a4f
commit
a72b422e15
@ -57,6 +57,10 @@ class User extends Authenticatable
|
||||
static::retrieved(function($model) {
|
||||
$model->setCompanyIds();
|
||||
});
|
||||
|
||||
static::saving(function($model) {
|
||||
$model->unsetCompanyIds();
|
||||
});
|
||||
}
|
||||
|
||||
public function companies()
|
||||
@ -194,4 +198,9 @@ class User extends Authenticatable
|
||||
|
||||
$this->setAttribute('company_ids', $company_ids);
|
||||
}
|
||||
|
||||
public function unsetCompanyIds()
|
||||
{
|
||||
$this->offsetUnset('company_ids');
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user