Weave Code
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

Annotations Laravel Package

zeptech/annotations

Parses case-insensitive PHPDoc annotations from classes, methods, and properties via Reflection. Exposes annotations as objects with array access, supports defaults/false/null semantics, and includes an AnnotationFactory that caches parsed results by docblock hash for speed.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit: The package is a lightweight, standalone annotation parser suitable for niche Laravel use cases (e.g., custom domain-specific metadata in models/services) but doesn't integrate with Laravel's native annotation systems like Doctrine-based routing or ORM annotations. It's designed for scenarios where explicit docblock parsing is needed outside Laravel's ecosystem.
Integration feasibility: High. Composer-based installation requires minimal boilerplate. The factory pattern simplifies reuse across classes, and PHP 8 compatibility ensures compatibility with modern Laravel versions (8+). The implementation involves straightforward instantiation of ReflectionClass or using AnnotationFactory for caching.
Technical risk: Low to medium. Core functionality is stable, but low adoption (0 dependents) and limited community testing. Known limitations include incomplete type handling (e.g., quoted strings, mixed-type lists), no support for deep nesting without JSON fallback, and potential edge-case bugs in complex scenarios. The package hasn't had recent releases beyond 1.2.0, which may indicate reduced maintenance.
Key questions:

  • How will this interact with Laravel's existing metadata systems (e.g., Eloquent casts, route definitions) to avoid conflicts?
  • What are the performance implications when parsing annotations at scale (e.g., in high-traffic middleware or during bootstrapping)?
  • Does the reliance on stdClass for JSON-parsed values create maintenance overhead for developers when handling complex structures?

Integration Approach

Stack fit: Works natively with Laravel's PHP stack but requires manual implementation. It's not compatible with Laravel's built-in annotation tools (e.g., laravel-annotations package), so it would serve as a standalone solution for custom use cases like service-layer configuration or domain-specific metadata. Best suited for isolated components where Laravel's native solutions aren't applicable.
Migration path: Ideal for greenfield projects where annotations are explicitly needed. For existing codebases, replace legacy docblock parsers (if any) with this library, but avoid mixing with Doctrine-based systems. Requires rewriting annotations to match the library's syntax rules (e.g., using JSON for nested structures instead of relying on deep nesting).
Compatibility: Fully compatible with Laravel 8+ (PHP 7.3+). No conflicts with common Laravel packages since it's a low-level parser. The factory's md5 caching aligns with Laravel's performance optimizations for repeated parsing.
Sequencing:

  1. Add to composer.json and install via Composer.
  2. Identify specific classes/services needing annotation parsing (e.g., custom repository layers or middleware logic).
  3. Implement factory-based initialization to cache annotations where reuse is common (e.g., in controllers or service classes).
  4. Gradually adopt syntax for critical metadata (e
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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport
twbs/bootstrap4