<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Spatie\Activitylog\LogOptions;
use Spatie\Activitylog\Traits\LogsActivity;
use App\Http\Traits\Timezone;
class EmailSwitches extends Model
{
    use HasFactory, Timezone;
    protected $casts = [
        'created_at' => 'datetime:d-m-Y H:i:s',
   ];

    protected static $submitEmptyLogs = false;
    protected static $recordEvents = ['deleted', 'created'];
    public $timestamps = false;
    public $pageName = "EmailSwitchesSettings";
    protected $table = 'email_switch_settings';
    protected $fillable = ['key', 'value'];


    public function tapActivity(string $eventName)
    {
        if ($eventName == 'saved') {
            return null;
        }
    }

    public function getActivitylogOptions(): LogOptions
    {
        return LogOptions::defaults()
            ->useLogName('system')
            ->submitEmptyLogs(false)
            ->logFillable()
            ->logExcept(['created_at', 'updated_at']);
    }
}
