public function createUser($username, $password, array $data = [])
    {
        /** @var UserInterface|EloquentUser $user */
        $user = $this->sentinel->registerAndActivate([
            'email'    => $username,
            'password' => $password,
        ]);

        if ( ! $user) {
            // @codeCoverageIgnoreStart
            throw new \Exception("Failed to create user '{$username}'");
            // @codeCoverageIgnoreEnd
        }

        $user->update($data);

        return $user;
    }
public function createUser($username, $password, array $data = [])
    {
        /** @var UserInterface|EloquentUser $user */
        $user = $this->sentinel->registerAndActivate([
            'email'    => $username,
            'password' => $password,
        ]);

        if ( ! $user) {
            // @codeCoverageIgnoreStart
            throw new \Exception("Failed to create user '{$username}'");
            // @codeCoverageIgnoreEnd
        }

        $user->update($data);

        return $user;
    }
public function createUser ( $ username , $ password , array $ data = [ ] ) { /** @var UserInterface|EloquentUser $user */ $ user = $ this -> sentinel -> registerAndActivate ( [ 'email' => $ username , 'password' => $ password , ] ) ; if ( ! $ user ) { // @codeCoverageIgnoreStart throw new \ Exception ( "Failed to create user '{$username}'" ) ; // @codeCoverageIgnoreEnd } $ user -> update ( $ data ) ; return $ user ; }
Create new CMS user.

@param string $username
@param string $password
@param array  $data
@return UserInterface
@throws \Exception
Create new CMS user .