From 2dbb2b71fea2813d0b6f1535cebfa859b357da70 Mon Sep 17 00:00:00 2001 From: Roy Duineveld Date: Tue, 14 Dec 2021 16:37:30 +0100 Subject: [PATCH] Use booting instead of booted in models --- src/Models/Attribute.php | 2 +- src/Models/Block.php | 2 +- src/Models/Category.php | 2 +- src/Models/Config.php | 2 +- src/Models/Page.php | 2 +- src/Models/Product.php | 2 +- src/Models/Quote.php | 2 +- src/Models/Rewrite.php | 2 +- src/Models/Store.php | 2 +- src/Models/Widget.php | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Models/Attribute.php b/src/Models/Attribute.php index 3389db589..22d31d49a 100644 --- a/src/Models/Attribute.php +++ b/src/Models/Attribute.php @@ -12,7 +12,7 @@ class Attribute extends Model protected $primaryKey = 'attribute_id'; - protected static function booted() + protected static function booting() { static::addGlobalScope(new OnlyProductAttributesScope()); } diff --git a/src/Models/Block.php b/src/Models/Block.php index bbf2b728b..a81e7fb1d 100644 --- a/src/Models/Block.php +++ b/src/Models/Block.php @@ -12,7 +12,7 @@ class Block extends Model protected $primaryKey = 'block_id'; - protected static function booted() + protected static function booting() { static::addGlobalScope(new IsActiveScope()); static::addGlobalScope(new ForCurrentStoreScope()); diff --git a/src/Models/Category.php b/src/Models/Category.php index 068dbe42e..32452614a 100644 --- a/src/Models/Category.php +++ b/src/Models/Category.php @@ -11,7 +11,7 @@ class Category extends Model protected $appends = ['url']; - protected static function booted() + protected static function booting() { static::addGlobalScope(new IsActiveScope()); static::addGlobalScope('defaults', function (Builder $builder) { diff --git a/src/Models/Config.php b/src/Models/Config.php index 240d7cd2e..e8c480d91 100644 --- a/src/Models/Config.php +++ b/src/Models/Config.php @@ -12,7 +12,7 @@ class Config extends Model protected $primaryKey = 'config_id'; - protected static function booted() + protected static function booting() { static::addGlobalScope('scope-fallback', function (Builder $builder) { $builder diff --git a/src/Models/Page.php b/src/Models/Page.php index 7a0ae95f4..d7c256084 100644 --- a/src/Models/Page.php +++ b/src/Models/Page.php @@ -11,7 +11,7 @@ class Page extends Model protected $primaryKey = 'page_id'; - protected static function booted() + protected static function booting() { static::addGlobalScope(new IsActiveScope()); static::addGlobalScope(new ForCurrentStoreScope()); diff --git a/src/Models/Product.php b/src/Models/Product.php index ec8cd3798..10c55337d 100644 --- a/src/Models/Product.php +++ b/src/Models/Product.php @@ -31,7 +31,7 @@ class Product extends Model protected $appends = ['formatted_price', 'url']; - protected static function booted(): void + protected static function booting(): void { static::addGlobalScope(new WithProductAttributesScope()); static::addGlobalScope(new WithProductSuperAttributesScope()); diff --git a/src/Models/Quote.php b/src/Models/Quote.php index 91e5aea33..3c15d7c04 100644 --- a/src/Models/Quote.php +++ b/src/Models/Quote.php @@ -18,7 +18,7 @@ class Quote extends Model 'cross_sells' => CommaSeparatedToArray::class, ]; - protected static function booted() + protected static function booting() { static::addGlobalScope(new IsActiveScope()); static::addGlobalScope('with-all-information', function (Builder $builder) { diff --git a/src/Models/Rewrite.php b/src/Models/Rewrite.php index adf3d99ec..1dcd938ba 100644 --- a/src/Models/Rewrite.php +++ b/src/Models/Rewrite.php @@ -10,7 +10,7 @@ class Rewrite extends Model protected $primaryKey = 'url_rewrite_id'; - protected static function booted() + protected static function booting() { static::addGlobalScope('store', function (Builder $builder) { $builder->where('store_id', config('rapidez.store')); diff --git a/src/Models/Store.php b/src/Models/Store.php index de4ce4f0a..2eee275f7 100644 --- a/src/Models/Store.php +++ b/src/Models/Store.php @@ -14,7 +14,7 @@ class Store extends Model protected $primaryKey = 'store_id'; - protected static function booted() + protected static function booting() { static::addGlobalScope(new IsActiveScope()); static::addGlobalScope('defaults', function (Builder $builder) { diff --git a/src/Models/Widget.php b/src/Models/Widget.php index 0ef52c268..2b28eb83d 100644 --- a/src/Models/Widget.php +++ b/src/Models/Widget.php @@ -14,7 +14,7 @@ class Widget extends Model 'widget_parameters' => 'object', ]; - protected static function booted() + protected static function booting() { static::addGlobalScope('with-all-info', function (Builder $builder) { $builder->join('widget_instance_page', 'widget_instance_page.instance_id', '=', 'widget_instance.instance_id');