company model boot optimize

This commit is contained in:
Cüneyt Şentürk 2022-03-02 17:43:54 +03:00
parent b59f4006ed
commit 2fa5b599a2

View File

@ -81,13 +81,17 @@ class Company extends Eloquent implements Ownable
{
parent::boot();
static::retrieved(function($model) {
$model->setCommonSettingsAsAttributes();
});
try { // TODO will optimize..
static::retrieved(function($model) {
$model->setCommonSettingsAsAttributes();
});
static::saving(function($model) {
$model->unsetCommonSettingsFromAttributes();
});
static::saving(function($model) {
$model->unsetCommonSettingsFromAttributes();
});
} catch(\Throwable $e) {
}
}
public function documents()