Export to Excel not working (Case mismatch between loaded and declared class names)

PHPMaker v2026.8
PHP 8.3.x

Basic module with Export to Excel not working with error as below:

[RuntimeException] Case mismatch between loaded and declared class names: "PHPMaker2026\MyProject\VIEWPROJECTList" vs "PHPMaker2026\MyProject\ViewProjectList". in E:\Apps\laragon\www\myproject\vendor\symfony\error-handler\DebugClassLoader.php:342 Trace: #0 E:\Apps\laragon\www\myproject\vendor\symfony\error-handler\DebugClassLoader.php(318): Symfony\Component\ErrorHandler\DebugClassLoader->checkClass('PHPMaker2026\My...', 'E:\Apps\laragon...') #1 [internal function]: Symfony\Component\ErrorHandler\DebugClassLoader->loadClass('PHPMaker2026\My...') #2 E:\Apps\laragon\www\myproject\src\ExportHandler.php(285): class_exists('PHPMaker2026\My...') #3 E:\Apps\laragon\www\myproject\src\ExportHandler.php(63): PHPMaker2026\MyProject\ExportHandler->exportData('excel', 'VIEW_PROJECT', NULL, true, false) #4 E:\Apps\laragon\www\myproject\controllers\ApiController.php(226): PHPMaker2026\MyProject\ExportHandler->__Invoke() #5 E:\Apps\laragon\www\myproject\vendor\symfony\http-kernel\HttpKernel.php(183): PHPMaker2026\MyProject\ApiController->export('excel', 'VIEW_PROJECT', NULL) #6 E:\Apps\laragon\www\myproject\vendor\symfony\http-kernel\HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1) #7 E:\Apps\laragon\www\myproject\vendor\symfony\http-kernel\Kernel.php(193): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #8 E:\Apps\laragon\www\myproject\vendor\symfony\runtime\Runner\Symfony\HttpKernelRunner.php(35): Symfony\Component\HttpKernel\Kernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #9 E:\Apps\laragon\www\myproject\vendor\autoload_runtime.php(32): Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run() #10 E:\Apps\laragon\www\myproject\index.php(8): require_once('E:\Apps\laragon...') #11 {main}

If you table/view name is "VIEW_PROJECT", the generated class should be ViewProjectList, not VIEWPROJECTList. If you have generated your scripts to an old project folder (e.g. created by previous versions), you better delete all files and generate again. Then check the generated file, it should be ViewProjectList.php, and the class name in the script should be ViewProjectList.

If you uploaded to an older folder, also make sure you delete all older scripts from the server first.

Also read Migrating to v2026 -> Project Structure and Namespace:

IMPORTANT: DO NOT generate or upload a new Symfony project into an old project folder.

Better also delete cache from your server, i.e. var/cache/prod/**.

No, this is totally new project. All scripts generated by PHPMaker v2026. I did not do any customization. And yes, I’m aware to always clear the var/cache folder.

Also it happens to all the module with Export, not just this module.

As suggested:

Looks correct to me. This is file in models\ViewProjectList.php

The issue is due to the src\ExportHandler.php script.

Just change from this:

To this:

image

Symfony's u()->pascal() doesn't lowercase first, so VIEW_PROJECT became VIEWPROJECT (just stripped underscores) instead of ViewProject. The PascalCase() helper in phpfn.php didn't account for all-uppercase input.

Fix: Added strtolower() before PascalCase() on lines 280 and 282 of ExportHandler.php

Please fix this. Thanks!

Update template and try again.

1 Like