public function attachUserToTeamByInvitation($invitationId, $user)
    {
        $userModel = get_class($user);

        $inviteModel = get_class((new $userModel)->invitations()->getQuery()->getModel());

        $invitation = (new $inviteModel)->where('token', $invitationId)->first();

        if ($invitation) {
            $invitation->team->users()->attach([$user->id], ['role' => Spark::defaultRole()]);

            $user->switchToTeam($invitation->team);

            $invitation->delete();
        }
    }