Advertisement
Guest User

Untitled

a guest
Apr 15th, 2016
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. <?php
  2.  
  3. public function loginUser(Request $request)
  4. {
  5. $email = $request->input('email');
  6. $password = $request->input('password');
  7. $user = User::makeVisible('password')->where('email', $email);
  8. if(!empty($user->count()))
  9. {
  10. $user = $user->toArray();
  11.  
  12. if (\Hash::check($password, $user['password']))
  13. {
  14. echo 'logged in';
  15. }
  16. else
  17. {
  18. echo 'wrong email or password';
  19. }
  20.  
  21. }
  22. else
  23. {
  24. echo 'wrong email or password';
  25. }
  26.  
  27.  
  28. }
  29. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement