This is not the regular “unknown column error”. As you can see below
“SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘$userEmail’ in ‘where clause’\nThe SQL being executed was: select * from user WHERE email = $userEmail”
as you can see from the error above it is picking the variable $userEmail as a column.
Below is method that has the simple query:
public static function findByLoginDetail($userEmail)
{
return static::findBySql('select * from user WHERE `email` = $userEmail')->one();