added AuthController and StaffMember model, update auth config and routes

This commit is contained in:
Kwesi Banson Jnr
2026-07-17 21:10:38 +00:00
parent 4bf2ac98f8
commit 266c0ff097
5 changed files with 106 additions and 18 deletions

View File

@@ -0,0 +1,29 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
class AuthController extends Controller
{
// Your login method is likely here...
/**
* Log the user out of the application.
*/
public function logout(Request $request)
{
// 1. Log the user out
Auth::logout();
// 2. Invalidate the user's session
$request->session()->invalidate();
// 3. Regenerate the CSRF token for security
$request->session()->regenerateToken();
// 4. Redirect them back to the login page
return redirect('/login');
}
}