indigophp/doctrine-annotation-autoload
Laravel-friendly autoloading for Doctrine annotations. Automatically registers annotation classes so you can use Doctrine-style annotations without manual loader setup, reducing boilerplate and avoiding common “annotation not found” errors in PHP projects.
@ORM\Entity, @Route) are often manually mapped or ignored in autoloading, leading to runtime errors or inefficient reflection.doctrine/annotations), which is a battle-tested standard in PHP ORM/validation ecosystems.Illuminate\Database\Eloquent or Symfony Components) may overlap or conflict. No native Laravel service provider or Facade integration.@Route, API Platform’s @ApiResource).doctrine/orm or doctrine/annotations dependencies.composer.json as a post-autoload-dump script hook.AppServiceProvider).Attribute component).[ORM\Entity]) are the future standard, making this package obsolete long-term. Migration to attributes is inevitable.autoload-dev, files key optimizations), risking compatibility.bootstrap/app.php autoloader setup.symfony/property-access, api-platform/core).cache/data/models)? This package might duplicate or override it.composer.json scripts) that could conflict?roave/better-reflection or symfony/property-info for annotation parsing?autoload-dev config, custom Composer plugin)?@ORM\Entity).symfony/property-info.@Route (Symfony) or @ApiResource (API Platform).composer why-not indigophp/doctrine-annotation-autoload to check for conflicts.doctrine/annotations:^1.0 vs. ^2.0).composer.json:
"scripts": {
"post-autoload-dump": [
"Indigo\\DoctrineAnnotationAutoload\\AutoloadDump"
]
}
bootstrap/app.php (if conflicts arise):
$loader = require __DIR__.'/../vendor/autoload.php';
// Ensure this package’s hook runs last
ReflectionClass or doctrine/annotations directly.doctrine/annotations:^1.0. May fail with ^2.0 (PSR-4 changes).Illuminate\Database\Eloquent\Model::getMetadata().symfony/property-access or symfony/validator bundles.doctrine/annotations is installed (or doctrine/orm).composer dump-autoload.composer dump-autoload --optimize to generate autoload files.php artisan cache:clear.doctrine/orm:^3.0 with [ORM\Entity]).src/AutoloadDump.php).| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Composer autoload hook fails | Broken autoloading | Rollback: Remove package, use manual config. |
| Doctrine annotation parsing errors | Runtime ClassNotFoundException |
Validate annotations manually. |
| Conflict with Laravel’s autoloader | Eloquent metadata corruption | Disable package, use autoload-dev. |
| PHP 8.2+ incompatibility | Autoload generation fails | Migrate to PHP 8 attributes. |
| Abandoned package security risks | Unpatched vulnerabilities | Audit dependencies, isolate usage. |
How can I help you explore Laravel packages today?