morningtrain/wp-view
A lightweight Laravel package that brings WordPress-style view handling to your PHP applications, making it easy to render templates, pass data to views, and keep presentation logic clean and reusable.
Architecture fit. morningtrain/wp-view sits in the "bring Blade to WordPress" category: it wraps the standalone illuminate/view component (Blade compiler + view factory) and exposes it to WordPress's template loading path, adding WP-specific directives (e.g., loop/query helpers, escaping wrappers, @wp_head-style shortcuts). Architecturally this is a parallel templating layer bolted onto WP's native template hierarchy rather than a replacement for it, which means the integration surface is the template_include filter and the global $post/WP_Query scope. That is a well-understood pattern, but it is also the exact problem Roots' Acorn/Sage already solves with far greater maturity — so the architectural question is not "can Blade work in WP" (it can) but "why this implementation over Acorn."
Integration feasibility. Feasible only in a Composer-managed WordPress (Bedrock-style layout, or a plugin that ships its own vendor/). It assumes a writable Blade compile cache directory, which conflicts with immutable/containerized WP deployments unless the cache path is volume-mounted or pre-warmed. There is no indication of a WP-CLI command for cache clearing/compilation, so that would likely need to be built. For a classic FTP-managed WP install, integration cost rises sharply and the value proposition collapses.
Technical risk — this is the dominant finding. The package has 2 stars, 0 dependents, and an overall score of 0.04. That is a signal of a personal/internal utility published to Packagist rather than a maintained library. Specific risks to validate before adoption:
illuminate/view version constraints current. Expect the constraint to lag Laravel 10/11 and PHP 8.3.{!! !!} and directive compilation mean a bug in the compiler or an over-permissive directive can produce unescaped output in a CMS context — a real XSS vector. A low-audience package will not receive security review.$post/setup_postdata handling, and edge cases (nested queries, multisite switching) are unlikely to be covered.Key questions to answer before any commitment:
illuminate/view and PHP version constraints does composer.json declare, and do they resolve cleanly against our target stack?template_include, locate_template, or a bespoke loader — and does it preserve child-theme override precedence?wp_head/wp_footer/the_content filter ordering correctly, or does it require that themes call them manually?Stack fit. Best fit is a Bedrock-style, Composer-first WordPress where the team already writes Laravel. Poor fit for agencies maintaining many heterogeneous WP sites or any environment without deploy-time Composer. The honest comparison set is: Acorn/Sage (mature, opinionated, full framework bridge), Timber/Twig (mature, different syntax), or hand-rolled illuminate/view bootstrapping (~80 lines of glue). Given the package's maturity signals, the hand-rolled bootstrap is a legitimate alternative — it gives the same capability with no third-party dependency risk and full internal control.
Migration path. Adopt incrementally, never as a big-bang:
If the team is currently on Sage/Acorn, do not migrate — the overlap is near-total and the migration would trade a maintained dependency for an unmaintained one.
Compatibility. Pin exactly in composer.lock and treat upgrades as change-controlled events. Expect to need a compatibility shim if the illuminate/view constraint predates the current LTS. Verify PHP 8.2/8.3 and WP 6.4+ behavior explicitly rather than assuming.
Sequencing.
composer.json, loader, and directive list; resolve the six questions above.vcs or a fork under our org) so we control the release cadence.Maintenance. Assume we own this code from day one, regardless of the MIT license's permission to use it as-is. With 0 dependents, upstream fixes for Laravel/PHP/WP compatibility will not arrive on our schedule. Budget: a fork under the org namespace, an assigned maintainer, and a standing ~1–2 days per quarter to track illuminate/view and WP major releases. This must be explicit in the adoption decision, not implicit.
Support. There is no vendor, no SLA, and no community to escalate to. Internal ownership and an internal runbook are non-negotiable. The runbook needs: how to clear the Blade cache, how to pre-warm it at deploy, what to do when a template fails to compile, and how to roll back to native templates.
Scaling. Runtime performance is fine — Blade compiles to plain PHP and cached views are effectively as fast as hand-written templates. The scaling risks are operational, not computational:
blade:compile-equivalent step baked into the image, or a shared cache volume. Neither appears to ship with the package.Failure modes to plan for:
| Failure | Symptom | Mitigation |
|---|---|---|
Upstream illuminate/view incompatibility |
Fatal on Composer update | Exact pins, fork, controlled upgrades |
| Unwritable/cold compile cache | 500s on first hit per template, or persistent 500s | Pre-warm at deploy; verify perms in health check |
| Escaping/directive bug | Reflected XSS in rendered output | Source review of directives; CSP; output audit |
Global $post scope leak |
Wrong post rendered in loops/nested queries | Test nested WP_Query and multisite explicitly |
| Abandonment | Silent drift from supported PHP/WP | Fork + assigned maintainer |
| Loader conflict with child themes | Child theme templates ignored | Verify template_include precedence in staging |
Ramp-up. For developers with Laravel experience, Blade syntax is near-zero cost — perhaps half a day to learn the WP-specific directives. For WP-only developers, allow 2–3 days to become productive and longer to internalize escaping discipline ({{ }} vs {!! !!}), which is the single most common source of Blade-introduced bugs. The larger ramp cost is organizational: the team must accept ownership of a package nobody else uses, which is a governance conversation as much as a technical one.
Recommendation. Do not adopt as a dependency in its current state. Either (a) fork it under the org and treat it as internal code with a named maintainer, or (b) skip it entirely and bootstrap illuminate/view directly — the package's value-add over that is a thin directive layer that we would end up owning and rewriting anyway. The adoption case only becomes compelling if source review reveals meaningful, non-trivial WP integration logic (robust template-hierarchy resolution, cache warming, multisite handling) that would take more than a week to reproduce internally.
How can I help you explore Laravel packages today?