Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Annotation Reader

Annotation Reader Laravel Package

ibrows/annotation-reader

ibrows/annotation-reader parses PHP docblock annotations into structured objects, letting you read class, method and property metadata at runtime via reflection. A lightweight API for annotation scanning, useful for custom routing, ORMs, validation or framework features in Laravel and plain PHP proj...

View on GitHub
Deep Wiki
Context7

Base Annotation-Reader as enhanced Doctrine Annotation Reader

Frequently asked questions about Annotation Reader
What does ibrows/annotation-reader actually do?
It is a lightweight reader for PHP docblock annotations, using reflection to expose class, method and property metadata as structured objects. Instead of scattering configuration across your codebase, you attach metadata such as @Foo(...) to docblocks and read it at runtime. It wraps Doctrine-style annotation parsing behind a clean, container-resolved interface. The core is framework-agnostic with optional Laravel wiring.
How do I install ibrows/annotation-reader with Composer?
Add it with composer require ibrows/annotation-reader. Installation itself is straightforward because the package is small and dependency-light, but that also means it brings no batteries. Expect to supply your own wrapper interface, singleton binding, annotation-class autoloading strategy and caching layer. Run a time-boxed spike against your exact PHP and Laravel version before committing.
Which Laravel and PHP versions does ibrows/annotation-reader support?
The provided context does not confirm declared PHP or Laravel version constraints, so treat support as unverified. The project shows no adoption signals, commit activity or maintenance evidence, making PHP 8+ compatibility uncertain. Check the package composer.json constraints and run a spike on your target PHP/Laravel versions. Do not assume the declared ranges are inside your support window.
Does ibrows/annotation-reader ship a Laravel service provider and auto-discovery?
The package overview mentions an optional Laravel service provider, but technical review found no service provider, facade, config file or package auto-discovery. Verify what is actually in composer.json before relying on any of it. In practice, treat Laravel integration as an adapter your team builds and owns. Bind the reader as a singleton in AppServiceProvider::register() and keep vendor namespaces out of controllers, models and services.
Do I need to add my own caching for annotation parsing?
Reflection-based parsing is expensive enough to become a request-path hazard without caching, so a cache is effectively mandatory in production. The package advertises caching of parsed metadata to avoid repeated reflection overhead, but you should confirm the caching primitive exists and how keys are derived. Many integrations end up building their own layer keyed by class name plus file mtime. Wrap parsing behind your own boundary so caching and invalidation stay under your control.
Can I use custom annotation classes and namespaces with it?
Yes, the reader supports configurable annotation namespaces, custom annotation classes and ignored names. The classic failure mode is annotation class autoloading, historically solved with Doctrine's AnnotationRegistry::registerLoader('class_exists'). Make sure your custom annotation classes are PSR-4 autoloadable and explicitly registered. Test that a deliberately misspelled annotation does not silently pass through unnoticed.
Does ibrows/annotation-reader support PHP 8 attributes?
No, it parses docblock annotations only; native PHP 8 attributes are out of scope. In a greenfield or PHP 8+ codebase this is an architectural mismatch, since modern Laravel favors attributes, explicit config classes and container bindings. If you need attributes today, use ReflectionAttribute or a package built around it. Keep any docblock-based usage isolated behind an interface so an attribute implementation can drop in later without touching consumers.
What happens when an annotation is malformed or unparseable?
There is no documented syntax contract, and the codebase has a reputation for permissive or silent parse failures. That is dangerous because bad metadata surfaces as wrong routing, validation or authorization behavior rather than as an exception. Add error handling that converts silent misparses into boot-time failures. Cover the annotations you rely on with tests so regressions fail loudly in CI.
How does it compare to doctrine/annotations or phpdocumentor/reflection-docblock?
The realistic comparison set is doctrine/annotations (deprecated upstream), phpdocumentor/reflection-docblock, roave/better-reflection and ReflectionAttribute. ibrows/annotation-reader does not outrank any of them on support signals, stars, dependents or maintenance activity. Its only distinct offering is a small, container-resolved reader with optional Laravel wiring. If you are choosing fresh, prefer a maintained parser or native attributes.
Is it safe to use in production given zero stars and no maintenance?
Risk is high relative to value: zero stars, zero dependents, no CVE response evidence and no visible commit activity in the last 24 months. The pattern itself is also declining, since docblock annotations are the legacy branch of the configuration-strategy decision. The one genuine mitigant is that the code is trivially replaceable. Contain it behind an application-owned interface such as MetadataReader, bind it as a singleton, and pilot only on one isolated, non-customer-facing use case like a feature-flag declaration or scaffolding input.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections