yii2tech/illuminate
Integrates Laravel's Illuminate components into Yii2, letting applications use familiar Illuminate services alongside native Yii2 features. Ideal for bridging the two frameworks and reusing Laravel packages in Yii2 projects.
What the package actually is. yii2tech/illuminate is a Yii2 extension (not a code converter) that bootstraps a Laravel Illuminate\Container alongside a running Yii2 application. It gives Yii2 code access to Illuminate services — container resolution, database/Eloquent, support helpers, and related primitives — while Yii2 continues to own routing, sessions, identity, and the existing ActiveRecord layer. It is a coexistence shim, not an automated migration tool. Any roadmap framing that treats it as "the thing that migrates us to Laravel" is wrong and should be corrected before it reaches a steering committee.
Architecture fit. Fit is narrow and conditional. It is appropriate only for a brownfield Yii2 monolith where a full rewrite is unaffordable and the organisation wants a strangler-fig transition, adopting Laravel idioms incrementally inside the existing runtime. It is a poor fit for greenfield work, for services already behind an API boundary, and for teams that intend to reach Laravel as a final state quickly — in those cases a service extraction or parallel-run is cheaper than carrying two DI containers and two ORMs. The honest strategic read: this package buys incremental adoption of Laravel's data layer, not migration of the application framework.
Integration feasibility. Mechanically straightforward — Composer install, register a Yii2 application component, point the Illuminate database manager at the existing connection, and start writing Eloquent models next to ActiveRecord models. The friction is at the seams, not the wiring:
beginTransaction() and Illuminate's transaction manager are separate. Read-your-writes inconsistencies and partially-rolled-back state are plausible and hard to reproduce.user component and Laravel's auth guards do not interoperate. Any feature requiring Laravel-style auth needs bespoke glue.Technical risk (ranked).
illuminate/* constraint range and the PHP version it permits. This is the single question that can kill the initiative, and it should be answered in an afternoon, not a sprint.NOASSERTION means GitHub could not identify the licence. yii2tech packages are typically BSD-3-Clause, which would be permissive, but this must be confirmed from the LICENSE file by legal before any use — it is a gating item, not a formality.Key questions to resolve before commitment.
illuminate/* and PHP versions does the constraint set actually permit — and does that align with the Laravel version the target architecture assumes?Stack fit and the alternatives. The TPM's job is to position this against the alternatives rather than evaluate it in isolation.
| Option | Time to first value | Long-term cost | Fit |
|---|---|---|---|
yii2tech/illuminate bridge |
Low | Medium — dual-runtime debt, owned fork | Brownfield Yii2, no rewrite budget |
| Service extraction behind API/queue | Medium | Low | Best default for most cases |
| Framework-agnostic domain library | High | Lowest | Teams with patience and architectural discipline |
| Full rewrite | Very high | Low eventually | Only with executive air cover |
The bridge is defensible when the organisation has a large Yii2 estate, a hard deadline for modernising the data layer, and no appetite for a rewrite — and when leadership accepts that this is scaffolding with a scheduled demolition date. Without that explicit acceptance, it becomes permanent debt by default.
Migration path (recommended shape).
Compatibility work. Pin exact versions of illuminate/*, Yii2, and PHP minor; verify no Composer conflict with other yii2tech packages already in the tree; confirm the bootstrap does not collide with existing Yii2 DI container definitions or bootstrap-time configuration. Add dependency-upgrade CI early — the value of the bridge is that it lets you defer Laravel upgrades, and the risk is that you forget you deferred them.
Sequencing note. Do not sequence this in parallel with a Yii2 major upgrade or a PHP version bump. The package sits precisely on the version boundaries those projects move, and concurrent change makes attribution of failures impossible.
Maintenance. Treat as internal code from day one. Ongoing cost is modest in code terms — the bridge is thin — but non-trivial in dependency terms: you inherit Laravel security advisories for whichever illuminate/* versions you pin, while being off Laravel's supported upgrade treadmill. Budget a recurring quarterly review: advisory scan, patch decision, compatibility retest. Assign a named owner; unowned bridges rot silently.
Support. No vendor, no SLA, community issues only. Realistic support model is an internal SME plus the fork. Mitigate by keeping the bridge's footprint small enough that a competent Yii2/Laravel engineer can read the whole thing in an afternoon — that is the actual resilience property, not any support contract.
Scaling. Eloquent performs; the bridge is not the bottleneck. The scaling concerns are structural:
Failure modes to instrument for.
Ramp-up. The required profile — comfortable in both Yii2 and Laravel — is uncommon and expensive. Onboarding cost is real and should be priced into the business case. Documentation is thin upstream, so the pilot's convention doc and a short "how the two containers relate" primer are mandatory artefacts, not nice-to-haves. Estimate one to two weeks for a mid-level engineer to be productive in the bridged area, versus days for either framework alone.
TPM recommendation. Leverage it as a time-boxed accelerant with a pre-agreed demolition clause, gated on licence confirmation and a successful version-constraint spike. Do not adopt it as permanent architecture, do not let it become the default answer to "how do we modernise," and do not start it without naming the owner, the exit criterion, and the date at which the exit is reviewed.
How can I help you explore Laravel packages today?