Cartalyst\Sentinel\Throttling\ThrottleRepositoryInterface::log PHP Method

log() public method

Logs a new throttling entry.
public log ( string $ipAddress = null, Cartalyst\Sentinel\Users\UserInterface $user = null ) : void
$ipAddress string
$user Cartalyst\Sentinel\Users\UserInterface
return void
    public function log($ipAddress = null, UserInterface $user = null);

Usage Example

 /**
  * {@inheritDoc}
  */
 public function fail(UserInterface $user = null)
 {
     // We'll check throttling firstly from any previous attempts. This
     // will throw the required exceptions if the user has already
     // tried to login too many times.
     $this->checkThrottling('login', $user);
     // Now we've checked previous attempts, we'll log this latest attempt.
     // It'll be picked up the next time if the user tries again.
     $this->throttle->log($this->ipAddress, $user);
 }