I'm using the login form from Symfony, but I can't login, if the entered username is 'FOO' and in the DB is stored 'foo'. I'm using Postgres. It means the username-field is case sensitive. What can I do?
This depends mainly on your Database-Server. MySQL is case insensitive, PostgreSQL is case sensitive.
But you can write query Like this
$this->createQueryBuilder('user')
->where('LOWER(user.username) = :username')
->setParameter('username', strtolower($username))
->getQuery()
->getResult()
;
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.