Skip to content

Instantly share code, notes, and snippets.

@flyingluscas
Created February 22, 2017 17:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flyingluscas/65f83935af583aa5f68e5a870ec2983d to your computer and use it in GitHub Desktop.
Save flyingluscas/65f83935af583aa5f68e5a870ec2983d to your computer and use it in GitHub Desktop.
Simple Laravel Auth Example
public function login(Request $request)
{
    $email = $request->email;
    $password = $request->password;

    $user = User::where('email', $email)->first();

    if (! $user || ! Hash::check($password, $user->password)) {
        return 'You shall not pass!';
    }

    return 'Ok, you can pass :)';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment