From 3a7277faa074e5f373d8b2ea6fc0e3ea56612a8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Duli=C3=A7i?= Date: Tue, 19 Jan 2021 17:27:19 +0300 Subject: [PATCH] use the new booted method --- app/Abstracts/Model.php | 6 ++---- app/Models/Banking/Transaction.php | 6 ++---- app/Models/Common/Contact.php | 6 ++---- app/Models/Document/Document.php | 6 ++---- app/Models/Setting/Setting.php | 10 +++------- 5 files changed, 11 insertions(+), 23 deletions(-) diff --git a/app/Abstracts/Model.php b/app/Abstracts/Model.php index f24fc14be..93db8fd67 100644 --- a/app/Abstracts/Model.php +++ b/app/Abstracts/Model.php @@ -28,14 +28,12 @@ abstract class Model extends Eloquent } /** - * The "booting" method of the model. + * The "booted" method of the model. * * @return void */ - protected static function boot() + protected static function booted() { - parent::boot(); - static::addGlobalScope(new Company); } diff --git a/app/Models/Banking/Transaction.php b/app/Models/Banking/Transaction.php index 6013cadbe..d57ec6575 100644 --- a/app/Models/Banking/Transaction.php +++ b/app/Models/Banking/Transaction.php @@ -54,14 +54,12 @@ class Transaction extends Model public $cloneable_relations = ['recurring']; /** - * The "booting" method of the model. + * The "booted" method of the model. * * @return void */ - protected static function boot() + protected static function booted() { - parent::boot(); - static::addGlobalScope(new Scope); } diff --git a/app/Models/Common/Contact.php b/app/Models/Common/Contact.php index 0d84f9f68..3a207be7b 100644 --- a/app/Models/Common/Contact.php +++ b/app/Models/Common/Contact.php @@ -43,14 +43,12 @@ class Contact extends Model public $sortable = ['name', 'email', 'phone', 'enabled']; /** - * The "booting" method of the model. + * The "booted" method of the model. * * @return void */ - protected static function boot() + protected static function booted() { - parent::boot(); - static::addGlobalScope(new Scope); } diff --git a/app/Models/Document/Document.php b/app/Models/Document/Document.php index e2378487b..56416db6a 100644 --- a/app/Models/Document/Document.php +++ b/app/Models/Document/Document.php @@ -73,14 +73,12 @@ class Document extends Model public $cloneable_relations = ['items', 'recurring', 'totals']; /** - * The "booting" method of the model. + * The "booted" method of the model. * * @return void */ - protected static function boot() + protected static function booted() { - parent::boot(); - static::addGlobalScope(new Scope); } diff --git a/app/Models/Setting/Setting.php b/app/Models/Setting/Setting.php index 0ba333fe1..b80df4cb0 100644 --- a/app/Models/Setting/Setting.php +++ b/app/Models/Setting/Setting.php @@ -17,16 +17,12 @@ class Setting extends Eloquent public $timestamps = false; /** - * Attributes that should be mass-assignable. + * The "booted" method of the model. * - * @var array + * @return void */ - protected $fillable = ['company_id', 'key', 'value']; - - protected static function boot() + protected static function booted() { - parent::boot(); - static::addGlobalScope(new Company); }