<?php

namespace MoneyTransfer\AuditLog;

use Illuminate\Database\Eloquent\Model;

class AuditLog
{
    public static function getReferenceName(string $screen, Model $data): string
    {
        return match ($screen) {
            'user', 'auth' => $data->name,
            default => $data->name ?: $data->title ?: ($data->id ? "ID: $data->id" : ''),
        };
    }
}
