Eloquent ORM query

Wednesday, November 4, 2015

I'm creating a login code using eloquent with slim framework and this is my code:



$app = \Slim\Slim::getInstance();
$password = $app->request->post('password');
$username = $app->request->post('username');

if(\User::where('username', '=', $username)->exists() AND \User::where('password', '=', $password)->exists()) {
echo "yes";
} else {
echo "no";
}


I always get no with my code. Am I doing it correctly?

0 comments:

Post a Comment