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

View Laravel Package

aura/view

Aura.View implements the TemplateView and TwoStepView patterns using PHP itself as the template language, with file-based and closure templates, helpers, and sections. No runtime dependencies; requires PHP 8.4+.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. Buy: Stick with Buy. Aura.View ships zero runtime dependencies, is framework-agnostic, and is MIT-licensed (relaxed from BSD-2-Clause). Both are permissive, so this remains a legal-policy check, not a risk event. The alternative — hand-rolled include/require layout logic — is exactly what this package replaces.
  • Adoption Timing / Release Status: 7.0.0 is the first stable release of the 7.x line, published 2026-09-29. The notes are 7.0.0-beta1's, carried forward verbatim — nothing changed between beta1 and stable. Two consequences: (a) the beta-risk discount is now off, so 7.x can be scheduled on the roadmap rather than kept in a spike; (b) anyone who already validated against beta1 has zero upgrade delta — no re-test cycle, just a version pin.
  • Platform Roadmap Coupling: 7.0.0 requires PHP ^8.4 (up from >=5.4.0) with native parameter/return types under declare(strict_types=1). Adoption is now a platform decision, not just a templating decision — sequence it behind (or alongside) the PHP 8.4 upgrade, never before it. This is the single hard gate on the whole package.
  • Upgrade Budgeting: The version jumps 2.x → 7.x with no 3.x–6.x. Treat this as a migration project, not a patch bump. Direct callers are mostly unaffected; the cost lands on subclasses (matching native signatures required, or they fatal on load) and on wiring code (ViewFactory::newInstance() now takes a ViewSpec per registry; config/Common.php and the extra.aura block are gone; the Aura\View\_Config\ PSR-4 entry and the aura/di dev dependency are removed).
  • Extensibility / Architecture: New TemplateRegistryInterface, SearchPathInterface, and HelperRegistryInterface let us substitute module-aware registries (or precompiled name-to-file maps) instead of extending concrete classes. Path management is deliberately kept out of TemplateRegistryInterface so map-backed registries with no paths remain valid. Supports a "one template layer, many contributing modules" architecture — a build-vs-extend decision we can now make without forking.
  • Theming & Per-Client Customization: parent() renders the shadowed template by resuming search past the current directory. Search paths are first-hit-wins, so previously the shadowed file was simply unreachable — changing one block of a package template meant copying the whole file into a fork. Now only the diff ships. Directly enables white-label/brand variants and vendor-package overrides, and is the headline commercial reason to move to 7.x specifically.
  • Helper Ownership Policy: HelperRegistry::set() now throws HelperAlreadyRegistered on name collisions; override: true replaces deliberately, and is valid even when the name is free ("I accept replacing whatever is there"). has() is the way to branch. This forces an explicit answer to "who owns url/escape?" — valuable in multi-package apps, but a boot-time failure risk we must audit before rollout.
  • Debuggability: getNamespaces() / getNamespacePaths() make "which directory did this template come from?" answerable without reflection — the first real answer to the multi-module path-contribution problem. getNamespacePaths() returns [] for an unregistered namespace rather than throwing.
  • Feature Roadmap:
    • Dynamic UI Components: Closure-based templates (registry get() now guarantees \Closure, so $this binding works — and array callables that previously failed in bindTo() now work, fixing a latent bug) for reusable modals/cards without file overhead.
    • Layout Consistency: TwoStepView for standardized headers/footers across many pages.
    • Partial Reusability: Modularize templates (e.g. _sidebar.php) to DRY codebases.
    • Helper Ecosystem: Aura.Html wiring continues to work unchanged, no adapter — the helpers parameter stays ?object by design, because a View reaches helpers only through __call() and typing to the interface would exclude valid managers.
  • Use Cases:
    • Admin Dashboards: Context-aware sections via beginSection().
    • Server-Rendered Fragments: Closure-based templates for HTML/JSON fragments in API-first frontends.
    • Legacy Migration: Replace custom include/require logic with structured render() calls.
    • Security-Critical / Media-Agnostic Output: No escaper is shipped by design; escaping is explicit and ours to choose. Good for HTML/JSON/XML/email from one layer — but it is an engineering discipline cost, not a free win.

When to Consider This Package

  • Adopt if:

    • You are on PHP 8.4+ (or committed to it this cycle). This is non-negotiable for 7.x.
    • Your team prefers PHP-native templating over Blade/Twig.
    • You need layout/content separation (TwoStepView) or data-driven rendering (TemplateView).
    • You need per-module or per-client template overrides — parent() is the reason to move to 7.x specifically.
    • You need swappable registries (module-aware path resolution, precompiled maps, test doubles) via the new interfaces.
    • You need a zero-dependency, MIT-licensed rendering layer for distribution or embedding.
    • You want server-rendered output for SEO/crawlability without a JS templating stack.
    • You need a stable, not pre-release, dependency — satisfied as of 7.0.0 stable.
  • Look Elsewhere if:

    • You are pinned below PHP 8.4 with no near-term upgrade path — the 7.x line is closed to you, and 2.x is a dead end relative to this work.
    • You need built-in auto-escaping. The package is media-type agnostic and ships no escaper; pair it with Aura.Html or bring your own.
    • You need compiled/cached template compilation or Vite-integrated pipelines — not shipped here.
    • You need component-based DX (Livewire, React, Alpine + Blade).
    • Your team lacks PHP depth — steep curve versus Blade.
    • You rely on config/Common.php / extra.aura / Aura.Di 2.x kernel discovery, or on the Aura\View\_Config\ PSR-4 entry — that wiring is removed and must move into your framework's module class.
  • Migration blockers to clear first (7.0.0 breaking changes):

    • Any subclass overriding setters (e.g. setData($data)) must adopt matching native types or it fatals on load. This is the real migration surface, not callers.
    • Setters return void and are not fluent — chained setter calls break. (Adding any return type is the break; void vs static only picks which one.)
    • newInstance() long positional form replaced by ViewSpec objects ($helpers remains first, so newInstance() and newInstance($helpers) are unaffected; the long form fails with a \TypeError naming the parameter).
    • Double helper registration now throws — audit helper boot order; use has() or override: true. Registering the identical callable twice also throws. HelperRegistryInterface::set() gains the same third parameter, affecting anyone who already implements that interface.
    • endSection() without beginSection() throws (was silent capture under a null key).
    • Empty template name returns '' (wrapped in layout if set) instead of throwing TemplateNotFound — don't rely on that exception to catch missing configuration.
    • Unresolvable helper throws HelperNotFound (was a raw PHP Error); name-parse errors throw InvalidTemplateName (more than one ::) — catch Aura\View\Exception\*, not \InvalidArgumentException. Every exception now descends from Aura\View\Exception.
    • Registry getters return interfaces, not the concrete class — type against SearchPathInterface if you contribute paths.
    • InvalidHelpersObject is deprecated and never thrown (the ?object type means PHP's own \TypeError fires first). Retained so existing catch blocks resolve; removal in 8.0 — schedule the cleanup now.

How to Pitch It (Stakeholders)

Executives: "Aura.View 7.0.0 is now stable — the first GA release of the 7.x line, and unchanged since beta1, so there is no new technical risk to re-review. It's our server-side rendering layer: no JS templating, no runtime dependencies, MIT-licensed so procurement and legal are clean. The headline business capability is parent() — per-client and white-label template customization ships as a small diff instead of a forked package, which is where customization cost usually hides. The honest caveats: 7.x requires PHP 8.4, and the jump is 2.x → 7.x with no intermediate versions, so this is a funded migration tied to the platform upgrade, not a routine dependency bump. Scope it that way and the payoff is lower long-term maintenance on every customized page."

Engineering: *"What you get in 7.x (stable, no changes since beta1 — if you validated on beta, pin and ship):

  • parent(): render the shadowed template by resuming search past the current directory — override one block without copying the file.
  • TemplateRegistryInterface / SearchPathInterface / HelperRegistryInterface: substitute a module-aware or precompiled registry without extending concrete classes. Path management deliberately lives outside TemplateRegistryInterface so map-backed registries remain valid.
  • getNamespaces() / getNamespacePaths(): "which directory did this template come from?" is now answerable — previously it required reflection. Returns [] for an unregistered namespace instead of throwing.
  • Explicit helper ownership: set() throws HelperAlreadyRegistered; override: true to replace on purpose. No more silent last-one-wins. Audit helper boot order before rollout — this fails at boot.
  • Unified exception tree: everything descends from Aura\View\Exception.
  • ViewSpec groups map/paths/namespaces/extension per registry — the old flat signature interleaved view and layout settings and would have hit nine parameters.
  • Aura.Html wiring is unchanged, no adapter — the helpers parameter stays ?object because the View only reaches helpers through __call().

Cost: PHP 8.4 baseline, strict types, non-fluent setters, and a wiring change for newInstance(). Subclasses are the real migration surface, not callers."*

Devs: *"Pros:

  • No templating engine lock-in — plain PHP logic in templates.
  • parent() — stop copy-pasting vendor templates to tweak one section.
  • Sections — capture output for layouts (beginSection('sidebar')).
  • Closures — registry always hands back \Closure, so $this binding is reliable and templates are unit-testable (assertEquals($view(), $expected)). Array callables that used to blow up in bindTo() now work.
  • Interfaces — mock registries in tests instead of subclassing.

Cons / gotchas:

  • PHP 8.4 required; subclasses need matching native signatures or they fatal on load.
  • Setters return void — no chaining.
  • Manual escaping — no escaper ships by design; standardize on Aura.Html.
  • Helper collisions throw — check has() or pass override: true in module boot.
  • Empty template name renders '', not an exception — don't rely on TemplateNotFound to catch missing configuration.
  • Catch Aura\View\Exception\*, not \InvalidArgumentException, around name lookups.
  • InvalidHelpersObject is a no-op — kept only for legacy catch blocks; gone in 8.0."*
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.
mehedimi/laravel-amp-mail
happones/laravel-vue-i18n-generator
jwerd/inertia-table
siberfx/flysystem-wasabi
hollyit/token-replace
ippanelcom/laravel-sdk
adachsoft/changelog-linter
adachsoft/collection
payerurl/telegrambot-crypto-payment-instant-payout
dskripchenko/laravel-hybrid-search
riorizkyrainey/lara-ced
mehedimi/static-vel
zharp/zharp
nonsapiens/bigquery-model-sync
lgu-bayambang-ict-office/lgu-laravel-development-standards
andydefer/laravel-support
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel