Autoload and declare IOFactory before calling it
**require 'vendor/autoload.php';
use PhpOffice\PhpSpreadsheet{SpreadSheet, IOFactory};
use PhpOffice\PhpSpreadsheet\Writer\Xlsx; //Csv, Xls**
Before
$reader = IOFactory::createReader($inputFileType);
This solves your issues. Most of the tutorials on their site are not elaborate. Thanks