Developer Productivity & Quality Gates:
ClassNotFoundException errors in Laravel applications. Aligns with Laravel’s dependency management while adding a critical validation layer.Technical Debt Reduction:
composer.json, ensuring consistency in large codebases.Build vs. Buy Decision:
Use Cases:
composer.json autoload paths are broken).composer.json scripts or use a pre-commit hook (e.g., Husky) to catch issues early.App\Modules\).Illuminate\Support\) are correctly referenced.composer validate offers.composer install/dump-autoload, making integration trivial (adds ~1–2 seconds to runs).composer.json and need to validate autoloads across all subprojects.classmap entries for non-PSR-4 classes.ClassLoader::addPsr4() at runtime).files key for non-PSR-4 autoloading (e.g., legacy code).debug:container).*"This is a ‘set-and-forget’ quality gate for our Laravel codebase that will save the team 15–20% of debugging time spent on ‘Class not found’ errors. Here’s why it’s a no-brainer:
*"This package is a lightweight, zero-config way to enforce autoload hygiene in our Laravel projects. Here’s how we’ll use it:
composer.json under require-dev and run ./vendor/bin/check-autoloading.php in our pipeline.- name: Validate Autoload
run: php vendor/bin/check-autoloading.php
composer.json scripts:
"scripts": {
"validate-autoload": "php vendor/bin/check-autoloading.php",
"post-install-cmd": ["validate-autoload"]
}
php artisan autoload:validate
tests/ or resources/ by adding to composer.json:
"autoload-exclude": ["tests/", "resources/views/"]
vendor/laravel/), pass a custom root:
./vendor/bin/check-autoloading.php ./app
Tradeoff: Adds ~1–2s to CI, but catches errors that would otherwise hit QA or production. Let’s start with a pilot in [Project Y] and expand if it reduces autoload bugs by >30%."
*"This tool will save you hours of debugging by automatically checking if all classes in composer.json exist and are correctly autoloaded. Here’s how it helps you:
composer validate-autoload or add to your pre-commit hooks.composer.json—no framework-specific hacks.tests/) by updating composer.json.composer require --dev phpcq/autoload-validation
./vendor/bin/check-autoloading.php
```"
How can I help you explore Laravel packages today?