mirror of
https://github.com/Bigherollc/wticreatorstudio.git
synced 2026-07-31 05:16:49 -04:00
38 lines
949 B
PHP
38 lines
949 B
PHP
<?php
|
|
|
|
namespace Modules\Appearance\Entities;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Support\Facades\Cache;
|
|
use Modules\Seller\Entities\SellerProduct;
|
|
|
|
class HeaderProductPanel extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $guarded = ['id'];
|
|
|
|
public static function boot()
|
|
{
|
|
parent::boot();
|
|
|
|
self::created(function ($model) {
|
|
Cache::forget('HeaderSection');
|
|
Cache::forget('productSectionItems');
|
|
});
|
|
self::updated(function ($model) {
|
|
Cache::forget('HeaderSection');
|
|
Cache::forget('productSectionItems');
|
|
});
|
|
self::deleted(function ($model) {
|
|
Cache::forget('HeaderSection');
|
|
Cache::forget('productSectionItems');
|
|
});
|
|
}
|
|
|
|
public function product(){
|
|
return $this->belongsTo(SellerProduct::class,'product_id','id');
|
|
}
|
|
}
|