cycle/proxy-factory
Cycle Proxy Factory generates proxy classes for Cycle ORM entities, enabling lazy loading and deferred property access. It creates lightweight subclasses at runtime so relations and fields load only when accessed, improving performance without changing your domain code.
composer require <vendor>/<package>, then confirm the service provider is auto-discovered (standard on Laravel 8+). If the package ships a config file, publish it with php artisan vendor:publish --tag=<package>-config before touching type settings.public int|string $id;) and push it through the package's main entry point. This exercises the new union-type reflection path end-to-end in a few lines.ReflectionUnionType. Those three spots tell you whether the new support matches how you intend to use it.int|string or string|array. Keep unions out of core domain logic where a concrete type is clearer.if (is_int($x)) ... else ..., let the package's resolver interpret int|string and normalize the value. This is the main workflow v1.3.1 unlocks.@var int|string docblock alongside the typed property. Older package versions and static analyzers still read the docblock even when reflection can't express the union.TypeHandler-style extension point in the docs.int|string property usually maps to ['sometimes', 'integer', 'string']-style rules; verify the mapping rather than assuming.mixed is not a union. Reflection reports mixed as a named type (on 8.0) not a ReflectionUnionType; don't expect it to hit the new code path.ReflectionUnionType::getTypes() does not promise declaration order. Never rely on int|string coming back as int first.?int and int|null are equivalent in reflection; int|string|null is a three-member union. Confirm the package handles the null member explicitly.A&B syntax (8.1) will not be handled by the new resolver.var_dump((new ReflectionProperty($class, 'prop'))->getType()) — if you get a ReflectionNamedType instead of ReflectionUnionType, the package isn't reaching the v1.3.1 code path (often a stale cached class or an old version constraint).php artisan config:clear. Cached config is a common reason new unions appear unsupported in production but fine locally.${var} interpolation in the package's code may emit notices; suppress only after confirming they're harmless in your Laravel version.How can I help you explore Laravel packages today?