Last active
April 15, 2016 07:22
-
-
Save iqbalmalik89/0086eeb0505524682a18e56b6e755dfe to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function loginUser(Request $request) | |
{ | |
$email = $request->input('email'); | |
$password = $request->input('password'); | |
$user = User::makeVisible('password')->where('email', $email); | |
if(!empty($user->count())) | |
{ | |
$user = $user->toArray(); | |
if (\Hash::check($password, $user['password'])) | |
{ | |
echo 'logged in'; | |
} | |
else | |
{ | |
echo 'wrong email or password'; | |
} | |
} | |
else | |
{ | |
echo 'wrong email or password'; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment