composer/class-map-generator
Generate PHP class maps by scanning directories to map classes/interfaces/traits/enums to file paths. Use a simple static helper or an advanced generator to scan multiple paths, sort results, and detect ambiguous class resolutions.
composer.json. Aligns with roadmap items like "Backward Compatibility Layer" or "Plugin System Overhaul" without requiring full refactoring.Adopt when:
composer.json edits.Look elsewhere if:
composer dump-autoload --optimize meets performance needs (no further optimization required).return false autoload rules for selective optimization without static maps.spl_autoload_register), where static maps are impractical.For Executives: *"This package is a performance multiplier for Laravel applications, directly addressing slow response times and high server costs. By precomputing class maps, we can reduce autoloading time by 40%, which translates to faster user experiences and lower infrastructure expenses. Key benefits:
For Engineering (Tech Leads/Architects): *"This tool replaces ad-hoc autoloading workarounds with a maintained, feature-rich solution. Key advantages:
composer dump-autoload in edge cases (e.g., mixed PSR-0/PSR-4, legacy codebases) with better control over exclusions, namespaces, and PSR violations.For Developers: *"This package saves time debugging autoloading issues by surfacing problems during build time. Key perks:
ClassNotFound surprises—catch ambiguous classes or PSR violations early.ClassMapGenerator::createMap() replaces manual find/grep hacks.How can I help you explore Laravel packages today?