and I want the credentials is using a student id
Doable yes but just think about:
What if Bob happens to find out Joe's id? But you can use id, a username, instead of email, just change code where needed.
Just example of one of my apps.
public function authenticate(Request $request)
{
$credentials = $request->only('username', 'password');
if (Auth::attempt($credentials)) {
$request->session()->regenerate();
$path = $this->getRedirect(); // my custom function
return redirect()->intended($path);
}
$message = 'The provided credentials do not match our records.';
return redirect('login')->with('status', $message);
}
And see https://laravel.com/docs/12.x/authentication#authenticate-a-user-by-id