I am running Win 11 and here are the versions of the relevant components, I believe
X:\Macif\MikeBrice\PHPapps\Macif>composer -V Composer version 2.5.4 2023-02-15 13:10:06
X:\Macif\MikeBrice\PHPapps\Macif>php -v PHP 8.3.0 (cli) (built: Nov 21 2023 17:48:00) (NTS Visual C++ 2019 x64) Copyright (c) The PHP Group Zend Engine v4.3.0, Copyright (c) Zend Technologies
X:\Macif\MikeBrice\PHPapps\Macif>git -v git version 2.43.0.windows.1
I started with the command composer init and searched for the package phpoffice/phpspreadhseet. After attempting to answer the questions, not all of which I understood, the process completed without any error messages.
The directory vendor was created and in this space a sub-directory of phpoffice was created with phpspreasheet, so I assume the basic install was completed.
I entered the following command in an attempt to have the samples installed/downloaded:
composer require phpoffice/phpspreadsheet --prefer-source
This completed without errors:
X:\Macif\MikeBrice\PHPapps\Macif>composer require phpoffice/phpspreadsheet --prefer-source
./composer.json has been updated
Running composer update phpoffice/phpspreadsheet
Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Writing lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
Generating autoload files
1 package you are using is looking for funding.
Use the composer fund
command to find out more!
No security vulnerability advisories found
Using version ^1.29 for phpoffice/phpspreadsheet
X:\Macif\MikeBrice\PHPapps\Macif>
However there is still no subdirectory named samples in the phpspreadsheet directory.
What am I missing
Installation of phpspreadsheet with sample scripts
You're missing this part in the phpspreadsheet project :
https://github.com/PHPOffice/PhpSpreadsheet/blob/master/.gitattributes
As per the documentation, having it ignored from exports means it won't be included in the directory if used as a third-party vendor.