feat: implementation des logs de connexion et correction du chemin de stockage des documents
This commit is contained in:
27
app/Http/Controllers/Admin/LoginLogController.php
Normal file
27
app/Http/Controllers/Admin/LoginLogController.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?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
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user