Skip to content

Instantly share code, notes, and snippets.

@tarex
Created August 24, 2012 16:51
Show Gist options
  • Save tarex/3452803 to your computer and use it in GitHub Desktop.
Save tarex/3452803 to your computer and use it in GitHub Desktop.
laravel authentication , remember me
<?php
// if you need the strtolower or some other data tweaks.
// remember me
$remember = Input::get('remember');
$credentials = array(
'username' => strtolower(Input::get('email')­),
'password' => Input::get('password'),
'remember' => !empty($remember) ? $remember : null
);
if (Auth::attempt($credentials))
{
return Redirect::to('/');
}
// OR
// now using this.
if (Auth::attempt(Input::all()))
{
return Redirect::to('port');
}
else
{
Session::flash('login_problem', 'login problem');
return Redirect::to('login');
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment