<?php

namespace App\Services;

use App\Models\AdminAuditLog;
use App\Models\User;
use Illuminate\Database\Eloquent\Model;

class AdminAuditLogger
{
    public function log(User $admin, string $action, Model $auditable, array $metadata = []): void
    {
        AdminAuditLog::create([
            'admin_id' => $admin->id,
            'action' => $action,
            'auditable_type' => $auditable::class,
            'auditable_id' => $auditable->getKey(),
            'metadata' => $metadata,
        ]);
    }
}
