Cartalyst\Sentinel\Throttling\IlluminateThrottleRepository::log PHP Метод

log() публичный Метод

{@inheritDoc}
public log ( $ipAddress = null, Cartalyst\Sentinel\Users\UserInterface $user = null )
$user Cartalyst\Sentinel\Users\UserInterface
    public function log($ipAddress = null, UserInterface $user = null)
    {
        $global = $this->createModel();
        $global->fill(['type' => 'global']);
        $global->save();
        if ($ipAddress !== null) {
            $ipAddressThrottle = $this->createModel();
            $ipAddressThrottle->fill(['type' => 'ip', 'ip' => $ipAddress]);
            $ipAddressThrottle->save();
        }
        if ($user !== null) {
            $userThrottle = $this->createModel();
            $userThrottle->fill(['type' => 'user']);
            $userThrottle->user_id = $user->getUserId();
            $userThrottle->save();
        }
    }