forxer/blade-components-reflection

Runtime reflection utilities for class-based Blade components (settable attributes & constructor parameters).

Maintainers

Package info

github.com/forxer/blade-components-reflection

pkg:composer/forxer/blade-components-reflection

Transparency log

Statistics

Installs: 21

Dependents: 2

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.0 2026-07-02 11:00 UTC

This package is auto-updated.

Last update: 2026-07-02 11:05:09 UTC


README

Runtime reflection utilities for class-based Blade components. Given a component class, it reports the attributes a Blade tag can set on it:

  • AttributeReflector::settableProperties($class) — public, non-promoted, externally-settable properties (excludes static, promoted, private(set)/protected(set), and Illuminate\View\Component internals), kebab-cased.
  • AttributeReflector::constructorParameters($class) — every constructor parameter, with a required flag.

It is a small, provider-less library (no service provider, no config). Consumers that hydrate public properties from the Blade attribute bag at render time use it directly; the companion dev tool forxer/blade-components-ide-helper uses the same class to generate IDE metadata.

Installation

composer require forxer/blade-components-reflection

Usage

use Forxer\BladeComponentsReflection\AttributeReflector;

$properties = AttributeReflector::settableProperties(MyComponent::class);
// [['name' => 'variant', 'kebab' => 'variant', 'type' => 'string'], ...]

$parameters = AttributeReflector::constructorParameters(MyComponent::class);
// [['name' => 'label', 'kebab' => 'label', 'type' => 'string', 'required' => true], ...]

License

MIT