<?php

namespace App\Http\Controllers\Admin;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Models\LoginLog;

class LoginLogController extends Controller
{
    public function index(Request $request)
    {
        $query = LoginLog::latest();
        
        if ($request->has('email') && $request->email) {
            $query->where('email', $request->email);
        }
        
        $logs = $query->paginate(20);
        return view('admin.security.login-logs', compact('logs'));
    }
}
