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.
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:
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:
How can I help you explore Laravel packages today?