I am getting quite desperate with Laravel 5.4 and Eloquent Query builder. I am trying to retrieve a user by username and password.
I ve following columns in my db: ID, USERNAME, PASSWORD
Following query is working for me:
$user = UserModel::where(['username' => $username])->first();
while this one is not:
$user = UserModel::where(['password' => $password])->first();
I am printing out both $username
and $password
before the query, and both are exactly what they should be.
What can i possibly do wrong?
EDIT:
- Yes I really do store password in plain text.
- The method is a part of API based on Zend-xmlrpc-server
- PHP does not return any error or exceptions
- Xmlrpc server return "404 Unknown error" fault response.
- Yes i am sure, that values do not contain any invisible characters and are indeed correct.
- Values are hard coded in request, i also tried hard coding them directly in query with the same result.
- I am using Oracle (11g I think), Laravel 5.4, PHP 5.6
- Value pair is correct, this username belongs to this password and both are exactly in the same form as in database.
I tried following forms of queries with same results:
$user = UserModel::where('password', $password)->first();
$user = UserModel::where(['password' => $password])->first();
$user = UserModel::where('password', '=', $password)->first();
Variations with username lead to exactly same results as in the first one mentioned.