Skip to content

Instantly share code, notes, and snippets.

@iqbalmalik89
Last active April 15, 2016 07:22
Show Gist options
  • Save iqbalmalik89/0086eeb0505524682a18e56b6e755dfe to your computer and use it in GitHub Desktop.
Save iqbalmalik89/0086eeb0505524682a18e56b6e755dfe to your computer and use it in GitHub Desktop.
<?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