mirror of
https://github.com/Bigherollc/wticreatorstudio.git
synced 2026-01-16 19:05:08 -05:00
38 lines
977 B
PHP
38 lines
977 B
PHP
<?php
|
|
|
|
namespace Modules\FrontendCMS\Entities;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Support\Facades\Cache;
|
|
use Spatie\Translatable\HasTranslations;
|
|
|
|
class SubscribeContent extends Model
|
|
{
|
|
use HasFactory , HasTranslations;
|
|
|
|
protected $guarded = ['id'];
|
|
public $translatable = [];
|
|
public function __construct(array $attributes = [])
|
|
{
|
|
parent::__construct($attributes);
|
|
if (isModuleActive('FrontendMultiLang')) {
|
|
$this->translatable = ['title','subtitle','description'];
|
|
}
|
|
}
|
|
|
|
public static function boot()
|
|
{
|
|
parent::boot();
|
|
|
|
self::created(function ($model) {
|
|
Cache::forget('popupContent');
|
|
Cache::forget('suscriptionContent');
|
|
});
|
|
self::updated(function ($model) {
|
|
Cache::forget('popupContent');
|
|
Cache::forget('suscriptionContent');
|
|
});
|
|
}
|
|
}
|