How can one improve the security of a simple password authentication system in PHP?

Issue: One way to improve the security of a simple password authentication system in PHP is by implementing password hashing. Storing passwords in plain text is a security risk as they can be easily compromised if the database is breached. Hashing passwords adds an extra layer of security by converting the password into a unique string of characters that cannot be reversed.

// Hashing the password before storing it in the database
$hashed_password = password_hash($password, PASSWORD_DEFAULT);

// Verifying the hashed password during authentication
if (password_verify($input_password, $hashed_password)) {
    // Password is correct
} else {
    // Password is incorrect
}