28 lines
569 B
PHP
28 lines
569 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Admin;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use Illuminate\Http\Request;
|
|
|
|
use App\Models\LoginLog;
|
|
use Inertia\Inertia;
|
|
|
|
class LoginLogController extends Controller
|
|
{
|
|
public function index()
|
|
{
|
|
if (!auth()->user()->isSuperAdmin()) {
|
|
abort(403, 'Unauthorized. Super Admin only.');
|
|
}
|
|
|
|
$logs = LoginLog::with('user.tenant')
|
|
->orderBy('login_at', 'desc')
|
|
->paginate(50);
|
|
|
|
return Inertia::render('Admin/Logs', [
|
|
'logs' => $logs
|
|
]);
|
|
}
|
|
}
|