mirror of
https://github.com/Bigherollc/wticreatorstudio.git
synced 2026-07-31 05:16:49 -04:00
46 lines
1.3 KiB
PHP
46 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace Modules\Subscription\Entities;
|
|
|
|
use Modules\Subscription\Traits\Tenantable;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Support\Facades\Cache;
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
class SubscriptionSetting extends Model
|
|
{
|
|
use Tenantable;
|
|
|
|
protected $fillable = [];
|
|
|
|
protected $casts = [
|
|
'payment_gateways' => 'array'
|
|
];
|
|
|
|
public static function boot()
|
|
{
|
|
parent::boot();
|
|
/*self::created(function ($model) {
|
|
Cache::forget('SubscriptionSetting_' . SaasDomain());
|
|
});
|
|
self::updated(function ($model) {
|
|
Cache::forget('SubscriptionSetting_' . SaasDomain());
|
|
});
|
|
self::deleted(function ($model) {
|
|
Cache::forget('SubscriptionSetting_' . SaasDomain());
|
|
});*/
|
|
}
|
|
|
|
public static function getData()
|
|
{
|
|
//return Cache::rememberForever('SubscriptionSetting_' . SaasDomain(), function () {
|
|
//$setting = DB::table('subscription_settings')->where('Amsub_id', SaasInstitute()->id)->first();
|
|
$setting = DB::table('subscription_settings')->first();
|
|
if (!$setting) {
|
|
$setting = DB::table('subscription_settings')->first();
|
|
}
|
|
return $setting;
|
|
//});
|
|
}
|
|
}
|