Login with Email Address Instead of Username

How I can replace login with Username with login with email address? I linked my Database with the my project (use Gii) and I want to login only with the Email,but I get a lot of errors , I try to fix them but its a bit hard because I`m a bit new in Yii 2

Basically what you wanted to do could be done like the following:

  1. In LoginForm model, replace $username with $email

  2. In LoginForm::getUser(), call User::findByEmail($this->email) instead of User::findByUsername($this->username).

  3. In User model, implement findByEmail() method if not yet implemented.

Thx for answer