Skip to content

Instantly share code, notes, and snippets.

@fhferreira
Last active December 16, 2015 22:49
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 fhferreira/5509472 to your computer and use it in GitHub Desktop.
Save fhferreira/5509472 to your computer and use it in GitHub Desktop.
Auth Laravel
<?php
if (Auth::attempt($credentials))
{
// .. do your redirect
}
elseif ($user = User::where_email($data['email'])->first() and $user->password == sha1($data['password']))
{
$user->password = Hash::make($data['password']);
$user->save();
Auth::login($user->id);
}
else
{
// login failed
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment