<?php

declare(strict_types=1);

namespace App\Http\Controllers\Account;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Inertia\Inertia;
use Inertia\Response;

class LoginHistoryController extends Controller
{
    public function index(Request $request): Response
    {
        $loginHistories = $request->user()
            ->loginHistories()
            ->latest()
            ->paginate(15);

        return Inertia::render('Profile/LoginHistory', [
            'loginHistories' => $loginHistories,
        ]);
    }
}
