Adding Custom User Providers: The User Provider Contract
<?php
namespace Illuminate\Contracts\Auth;
interface UserProvider {
public function retrieveById($identifier);
public function retrieveByToken($identifier, $token);
public function updateRememberToken(Authenticatable $user, $token);
public function retrieveByCredentials(array $credentials);
public function validateCredentials(Authenticatable $user, array $credentials);
}
RetrieveById function
Typically receives a key representing the user, such as an auto-incrementing ID from a MySQL database.
RetrieveByToken function
Retrieves a user by their unique $identifier and "remember me" $token, stored in a field remember_token.
UpdateRememberToken method
RetrieveByCredentials method
Receives the array of credentials passed to the Auth::attempt method when attempting to sign into an application.
ValidateCredentials method
Related concepts
→
The User Provider Contract
→