Skip to content

Commit

Permalink
Use booting instead of booted in models
Browse files Browse the repository at this point in the history
  • Loading branch information
royduin committed Dec 14, 2021
1 parent 7fb81af commit 2dbb2b7
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/Models/Attribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Attribute extends Model

protected $primaryKey = 'attribute_id';

protected static function booted()
protected static function booting()
{
static::addGlobalScope(new OnlyProductAttributesScope());
}
Expand Down
2 changes: 1 addition & 1 deletion src/Models/Block.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
2 changes: 1 addition & 1 deletion src/Models/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/Models/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Models/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
2 changes: 1 addition & 1 deletion src/Models/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
2 changes: 1 addition & 1 deletion src/Models/Quote.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/Models/Rewrite.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand Down
2 changes: 1 addition & 1 deletion src/Models/Store.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/Models/Widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 2dbb2b7

Please sign in to comment.