• File: ImaliAccountConfig.php
  • Full Path: /var/www/imaliapi/app/Imali/ImaliAccountConfig.php
  • Date Modified: 04/15/2024 8:53 PM
  • File size: 1.02 KB
  • MIME-type: text/x-php
  • Charset: utf-8
<?php

namespace App\Imali;

use Illuminate\Database\Eloquent\Model;
use Spatie\Activitylog\LogOptions;
use Spatie\Activitylog\Traits\LogsActivity;
use DateTimeInterface;

class ImaliAccountConfig extends Model
{
    use LogsActivity;

    protected $fillable = ['taxa', 'level', 'nr_transaction', 'point_value', 'max_value_operation', 'max_value_year', 'max_balance', 'min_value_operation', 'taxa_refund_mechant'];

    protected static $logAttributes = [
        'taxa', 'level', 'nr_transaction', 'point_value', 'max_value_operation', 'max_value_year', 'max_balance', 'min_value_operation', 'taxa_refund_mechant'
    ];

    protected static $logName = 'kyc';

    public function getDescriptionForEvent(string $eventName): string
    {
        return "This model has been {$eventName}";
    }

    protected function serializeDate(DateTimeInterface $date)
    {
        return $date->format('d-m-Y H:i:s');
    }

    public function getActivitylogOptions(): LogOptions
    {
        return LogOptions::defaults()->logOnly(['*']);
    }
}