merged skunkworks into develop.
This commit is contained in:
@@ -2,45 +2,27 @@
|
||||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Authentication Username
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
} This option should be set to the "username" property of your users.
|
||||
| Typically, this will be set to "email" or "username".
|
||||
|
|
||||
| The value of this property will be used by the "attempt" closure when
|
||||
| searching for users by their username. It will also be used when the
|
||||
| user is set to be "remembered", as the username is embedded into the
|
||||
| encrypted cookie and is used to verify the user's identity.
|
||||
|
|
||||
*/
|
||||
|
||||
'username' => 'email',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Retrieve The Current User
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This closure is called by the Auth::user() method when attempting to
|
||||
| retrieve a user by their ID stored in the session.
|
||||
| This closure is called by the Auth class' "user" method when trying to
|
||||
| retrieve a user by the ID that is stored in their session. If you find
|
||||
| the user, just return the user object, but make sure it has an "id"
|
||||
| property. If you can't find the user, just return null.
|
||||
|
|
||||
| Simply return an object representing the user with the given ID. Or, if
|
||||
| no user with the given ID is registered to use your application, you do
|
||||
| not need to return anything.
|
||||
|
|
||||
| Of course, a simple, elegant authentication solution is already provided
|
||||
| for you using Eloquent and the default Laravel hashing engine.
|
||||
| Of course, a simple and elegant authentication solution has already
|
||||
| been provided for you using the query builder and hashing engine.
|
||||
| We love making your life as easy as possible.
|
||||
|
|
||||
*/
|
||||
|
||||
'user' => function($id)
|
||||
{
|
||||
if ( ! is_null($id) and filter_var($id, FILTER_VALIDATE_INT) !== false)
|
||||
if (filter_var($id, FILTER_VALIDATE_INT) !== false)
|
||||
{
|
||||
return User::find($id);
|
||||
return DB::table('users')->find($id);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -50,19 +32,19 @@ return array(
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This closure is called by the Auth::attempt() method when attempting to
|
||||
| authenticate a user that is logging into your application.
|
||||
| authenticate a user that is logging into your application. It's like a
|
||||
| super buff bouncer to your application.
|
||||
|
|
||||
| If the provided credentials are correct, simply return an object that
|
||||
| represents the user being authenticated. If the credentials are not
|
||||
| valid, don't return anything.
|
||||
|
|
||||
| Note: If a user object is returned, it must have an "id" property.
|
||||
| represents the user being authenticated. As long as it has a property
|
||||
| for the "id", any object will work. If the credentials are not valid,
|
||||
| you don't meed to return anything.
|
||||
|
|
||||
*/
|
||||
|
||||
'attempt' => function($username, $password, $config)
|
||||
'attempt' => function($username, $password)
|
||||
{
|
||||
$user = User::where($config['username'], '=', $username)->first();
|
||||
$user = DB::table('users')->where_username($username)->first();
|
||||
|
||||
if ( ! is_null($user) and Hash::check($password, $user->password))
|
||||
{
|
||||
@@ -72,12 +54,12 @@ return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Logout
|
||||
| Logout The Current User
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may do anything that needs to be done when a user logs out of
|
||||
| your application, such as call the logout method on a third-party API
|
||||
| you are using for authentication, or anything else you desire.
|
||||
| you are using for authentication or anything else you desire.
|
||||
|
|
||||
*/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user