The issue is that the column names in the database table do not match the keys in the Auth::attempt method. By default, Laravel expects the column names to be email and password. However, in this case, the column names are Benutzername and Password.
To fix this, you can specify the column names in the Auth::attempt method like this:
if (Auth::attempt(['Benutzername' => $credentials['benutzername'], 'Password' => $credentials['password']], true)) {
$request->session()->regenerate();
return redirect()->intended('home');
}
Note the second parameter true which tells Laravel to remember the user's session. Also, make sure that the Benutzername and Password column names are spelled correctly and match the case in the database table.
If you want to change the default column names for authentication, you can do so in the config/auth.php file. For example, to use username instead of email, you can change the providers.users.model section like this:
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => App\Models\User::class,
'table' => 'users',
'username' => 'username', // add this line
],
],