From 2fa5b599a2ea389b115e651b756f4e3b3666cf67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Wed, 2 Mar 2022 17:43:54 +0300 Subject: [PATCH] company model boot optimize --- app/Models/Common/Company.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/app/Models/Common/Company.php b/app/Models/Common/Company.php index e12cf2ec2..b5b6a28b2 100644 --- a/app/Models/Common/Company.php +++ b/app/Models/Common/Company.php @@ -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()