use Illuminate\Support\Facades\Auth; if (Auth::attempt(['email' => $email, 'password' => $password])) { // Authentication was successful. return redirect()->intended('dashboard'); } else { // Authentication failed. return back()->with('error', 'Invalid email or password.'); }In this example, we are attempting to log the user in using their email and password. If the `attempt` method returns `true`, then the user is redirected to the `dashboard` page. Otherwise, an error message is displayed and the user is redirected back to the login page. Package Library: Laravel Framework.