• File: BankAccount.php
  • Full Path: /var/www/imaliapitest/app/BankAccount.php
  • Date Modified: 05/19/2025 4:29 PM
  • File size: 1.01 KB
  • MIME-type: text/x-php
  • Charset: utf-8
<?php

namespace App;

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

class BankAccount extends Model
{
    use LogsActivity;

    protected $fillable = [
        'account_id', 'pin', 'account_name', 'user_account', 'phone', 'balance', 'logo', 'qrcode', 'taxa', 'user_id'
    ];

    protected static $logAttributes = ['account_id', 'pin', 'account_name', 'user_account', 'phone', 'balance', 'logo', 'qrcode', 'taxa', 'user_id'];

    protected static $logName = 'bankAccount';

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

    function user()
    {
        return $this->belongsTo(User::class);
    }

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

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