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

Reflecta Laravel Package

veewee/reflecta

Reflecta is a PHP library for fast, reflection-based class inspection, letting you read properties, methods, and attributes without instantiating objects. Useful for building analyzers, mappers, and framework tooling.

View on GitHub
Deep Wiki
Context7

🪞 Reflecta 🪞 - Unleash the Power of Optics in your code!

Frequently asked questions about Reflecta
What is veewee/reflecta used for?
Reflecta is a lightweight object-oriented wrapper around PHP's native reflection API. It provides fluent, type-safe access to class, method, property, parameter, type, and attribute metadata without instantiating the inspected objects. Developers use it for analyzers, mappers, package discovery, code generation, and framework tooling.
Is Reflecta a Laravel package with a service provider?
No. Reflecta is framework-agnostic and sits directly on top of PHP reflection, so it has no Laravel service provider, facade, config file, or lifecycle integration. You can still use it inside a Laravel project as a Composer dependency for internal tooling and Artisan commands. It is not designed for framework lifecycle hooks or request middleware.
How do I install Reflecta in a Laravel project?
Install it with Composer using composer require veewee/reflecta. There is no config publishing or service provider registration required. Because it wraps native reflection rather than replacing it, you can adopt it incrementally behind an internal abstraction and fall back to ReflectionClass or ReflectionMethod where needed.
Which PHP and Laravel versions does Reflecta support?
Reflecta requires PHP 8 or newer and is not tied to a specific Laravel version because it is framework-agnostic. Exact tested PHP 8.x minors and the CI matrix should be confirmed from the package's composer.json and repository metadata. In Laravel, compatibility is mainly driven by your application's PHP version rather than the framework release.
How does Reflecta simplify PHP 8 attributes and union or intersection types?
Reflecta provides simplified inspection of PHP 8 attributes, union and intersection types, and parameters through a more expressive API. It keeps native reflection concepts intact, so it reads as an ergonomics layer rather than a separate metadata system. This helps when building attribute-driven registries, analyzers, and discovery tools.
What does property_is_initialized add in Reflecta 1.2.0?
Version 1.2.0 adds property_is_initialized, which exposes whether a typed property has been assigned a value. This mirrors native ReflectionProperty::isInitialized behavior and is useful in serializers, fixture builders, and diagnostics. The change is additive, with no breaking changes or API removals. For readonly, static, inherited, or trait-provided properties, verify behavior against your supported PHP version.
Is Reflecta fast enough to use in Laravel request handling?
Reflection is best avoided in hot request paths unless you cache results and measure the impact. Reflecta adds an ergonomics layer over native reflection, so it belongs in development tooling, diagnostics, and non-critical runtime utilities. Do not introduce it into middleware or latency-sensitive request handling without benchmarking.
Can I use Reflecta for Artisan commands, package discovery, and analyzers?
Yes. Reflecta fits Laravel projects as a development and tooling dependency for custom Artisan commands, package discovery, attribute-based registries, documentation generators, architecture tests, and internal analyzers. Wrap its fluent API behind a small internal inspector interface so application code does not depend on it directly. Use it alongside native reflection in low-risk tools first, then expand if it proves useful.
How does Reflecta compare to native PHP reflection?
Reflecta is not a replacement for native reflection; it is a readable, type-safe wrapper over the same concepts. It can improve ergonomics for inspecting attributes, parameters, and member metadata, but it adds an extra dependency. Native APIs such as ReflectionProperty::isInitialized already cover some use cases, so evaluate whether the readability gain justifies the dependency.
Is Reflecta production-ready and well maintained?
The code risk appears low because reflection is a stable PHP capability and version 1.2.0 is a narrow additive release. The larger concern is ecosystem risk: limited public adoption, low GitHub stars, a single-maintainer profile, and release-metadata anomalies. Treat Reflecta as a convenience dependency for non-critical tooling, pin the version, validate it in CI, and avoid making it a production-critical platform dependency.
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.
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect
youbar/easy-crud
c-point-labs/laravel-hostyourai
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