<?php

namespace App\Support;

use Illuminate\Support\Facades\DB;

class SessionLoginTime
{
    public static function stamp(string $sessionId, int|string $userId): void
    {
        if ($sessionId === '') {
            return;
        }

        DB::table('sessions')
            ->where('id', $sessionId)
            ->where('user_id', $userId)
            ->whereNull('logged_in_at')
            ->update(['logged_in_at' => time()]);
    }
}
