\App\AuthAuthenticatesUsers

Trait for user authentication. Inspired by the original AuthenticatesUsers trait.

Summary

Methods
Properties
Constants
No public methods found
No public properties found
No constants found
login()
createFailedLoginMessage()
limiter()
provider()
guard()
sendLockoutResponse()
sendLoginResponse()
sendFailedLoginResponse()
$maxAttempts
$decayMinutes
$throttleKey
N/A
No private methods found
No private properties found
N/A

Properties

$maxAttempts

$maxAttempts : integer

Type

integer — Maximum amount of login attempts

$decayMinutes

$decayMinutes : integer

Type

integer — Time in minutes to block further login attempts for, once the limit is reached

$throttleKey

$throttleKey : string

Type

string — Throttle key template. Variables `{login}` and `{ip}` will be replaced with appropriate data.

Methods

login()

login(string  $login, string  $password, boolean  $remember, \Illuminate\Http\Request|null  $request = null) : mixed

Try to log in and return an appropriate response

Parameters

string $login

Username or email

string $password
boolean $remember
\Illuminate\Http\Request|null $request

Throws

\Illuminate\Validation\ValidationException

Returns

mixed

createFailedLoginMessage()

createFailedLoginMessage(\App\User|null  $user) : string

Return an error message about why the login failed.

Parameters

\App\User|null $user

Returns

string

limiter()

limiter() : \Illuminate\Cache\RateLimiter

Get the rate limiter instance

Returns

\Illuminate\Cache\RateLimiter

provider()

provider() : \Illuminate\Contracts\Auth\UserProvider

Get the user provider instance

Returns

\Illuminate\Contracts\Auth\UserProvider

guard()

guard() : \Illuminate\Contracts\Auth\StatefulGuard

Get the guard to be used during authentication.

Returns

\Illuminate\Contracts\Auth\StatefulGuard

sendLockoutResponse()

sendLockoutResponse(integer  $seconds) : mixed

The return value of login() for when the user has been forbidden from attempting to log in.

Parameters

integer $seconds

Time in seconds for how long the user has to wait before they can log in again.

Throws

\Illuminate\Validation\ValidationException

Returns

mixed

sendLoginResponse()

sendLoginResponse() : mixed

The return value of login() for when the login was successful.

Returns

mixed

sendFailedLoginResponse()

sendFailedLoginResponse(string  $failureMessage) : mixed

The return value of login() for when the login was unsuccessful.

Parameters

string $failureMessage

Message provided by createFailedLoginMessage()

Throws

\Illuminate\Validation\ValidationException

Returns

mixed