Cartalyst\Sentinel\Users\IlluminateUserRepository::fill PHP Method

fill() public method

Fills a user with the given credentials, intelligently.
public fill ( Cartalyst\Sentinel\Users\UserInterface $user, array $credentials ) : void
$user Cartalyst\Sentinel\Users\UserInterface
$credentials array
return void
    public function fill(UserInterface $user, array $credentials)
    {
        $this->fireEvent('sentinel.user.filling', compact('user', 'credentials'));
        $loginNames = $user->getLoginNames();
        list($logins, $password, $attributes) = $this->parseCredentials($credentials, $loginNames);
        if (is_array($logins)) {
            $user->fill($logins);
        } else {
            $loginName = reset($loginNames);
            $user->fill([$loginName => $logins]);
        }
        $user->fill($attributes);
        if (isset($password)) {
            $password = $this->hasher->hash($password);
            $user->fill(compact('password'));
        }
        $this->fireEvent('sentinel.user.filled', compact('user', 'credentials'));
    }