Prior to his sophomore season, head coach Jim Harbaugh announced that Hayes would backup Jalen Mayfield and Jon Runyan Jr.[4] As a sophomore in 2019, he played 12 games on the offensive line, including two starts.
[5] He made his collegiate debut on August 31, 2019, in a game against Middle Tennessee.
He started at left tackle in place of fifth-year senior Runyan, who sat out due to an injury.
[8][9] As a senior in 2021 he started all 14 games at left tackle and helped lead the offensive line with the fewest sacks allowed (10) and third-fewest tackles for loss (27) nationally and won the Joe Moore Award.
[13] He helped lead the offensive line with 12 sacks allowed and a 5.97 sack-adjusted yards per carry, and again won the Joe Moore Award.