<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Chats\ChatsRequestBuilderGetRequestConfiguration;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestConfiguration = new ChatsRequestBuilderGetRequestConfiguration();
$queryParameters = ChatsRequestBuilderGetRequestConfiguration::createQueryParameters();
$queryParameters->expand = ["lastMessagePreview"];
$requestConfiguration->queryParameters = $queryParameters;
$result = $graphServiceClient->chats()->get($requestConfiguration)->wait();