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

Nova Modal Response Laravel Package

markwalet/nova-modal-response

A Laravel Nova package that lets actions return modal responses. Show custom content, confirmations or messages in a modal without leaving the page—just return a ModalResponse from your action's handle method.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit

  • Purely a presentation-layer Nova asset. A PHP fluent builder (ModalResponse / Block) emits a JSON payload consumed by a bundled JS/Vue renderer inside a Nova action modal. No persistence, no queues, no service dependencies, no domain logic. A defect or a bad upgrade is contained to admin-panel action responses — nothing customer-facing, nothing in the request path of the product.
  • v2 is the strategically relevant version. The body changed from a single string to an ordered stack of typed blocks — text, headings, lists, dividers, code, JSON, HTML, markdown, Blade views, badges, icons, links, inline rows, collapsibles, tabs — with shared Size/Variant/Alignment enums. That typed block model is what makes it viable as a team-wide standard for admin messaging rather than a one-off convenience: it is a governed content-authoring abstraction, not just a modal helper.
  • Scope discipline matters. This is a render surface, not an interaction model. Multi-step wizards, in-modal forms, live filtering, or stateful editing are out of scope and should be treated as a build decision, not a package decision.
  • Hard prerequisite: Laravel Nova. Zero value outside Nova. Frame it in the roadmap as internal tooling infrastructure, not product capability.

Integration feasibility

  • Integration cost is a Composer dependency plus published/compiled front-end assets. No migrations, no config coupling, no infrastructure provisioning, no data-model impact. A single consuming app can adopt it inside one sprint with one engineer.
  • The breaking surface in v2 is narrow and identifiable before work starts, which is the property that matters for planning: apps using only the ModalResponse fluent API "usually just bump the dependency." Breakage concentrates in exactly two places — hand-built payloads via Action::modal('modal-response', [...]) (payload became { title, size, closeButtonText, blocks: [...] }) and the removed withoutSyntaxHighlighting() (deprecated since v1.1.3).
  • Sizing for a typical app: 0.5–1.5 dev-days for grep, fixture updates, and per-modal visual QA. Add ~1 day if published views/assets or bespoke JS touch the payload. This is a small, explicitly-scoped technical item — schedule it as such, not as a background chore.
  • Laravel Boost users have an ordering constraint: upgrade Boost to ≥1.3.0 before the package bump.

Technical risk

  • Silent failure is the dominant risk. A v1 payload against a v2 renderer degrades to an empty or partial modal with only a console.warn — no PHP exception, no failing test unless we assert payload shape. This cannot be mitigated by the library; it must be mitigated by process (golden-payload test + manual QA pass).
  • Stale compiled assets is the most likely real-world failure mode: Composer bumped, assets not re-published/rebuild in the same release, new payload rendered by old JS. Treat code plus assets as one atomic unit in one PR.
  • Maintainer concentration. ~17 stars, zero dependents, single primary maintainer. Acceptable precisely because the fallback is cheap (fork, vendor, or a handful of Blade views) and the blast radius is confined to admin UI — but it belongs in the risk register as a standing assumption, not as an approval blocker.
  • Unsanitized rendering. markdown, html, and view blocks render as given; Markdown preserves javascript: links and most raw HTML. Establish an internal convention now: view blocks render repo-controlled Blade only, markdown comes from static strings, and untrusted or AI-generated content uses text/list/code blocks or passes through a sanitization layer first.

Key questions

  • Which existing Nova actions return content a user must read (reports, diagnostics, logs, payloads, warnings) rather than a one-line confirmation? That inventory is both the adoption backlog and the QA matrix.
  • Does any code construct Action::modal('modal-response', [...]) directly, or call withoutSyntaxHighlighting()? This is a single grep and it decides whether the upgrade is a bump or a scoped migration.
  • Have we published or customized the package's views/assets, and who owns re-publishing and diffing them?
  • Is Laravel Boost in use, and at what version?
  • Do we have a rollback tag pinned (v1.3.0) and a documented restore procedure?

Integration Approach

Stack fit

  • Fits any Laravel app already running Nova, at any team size. No fit outside Nova; do not evaluate for customer-facing or framework-agnostic surfaces.
  • Positions cleanly alongside Nova's native response types rather than competing with them. Enforce the routing convention in code review: Action::message(...) for one-line confirmations, Action::download(...) for files, Action::redirect(...)/Action::visit(...) for navigation, ModalResponse only when the result is something the user should read or inspect. Without that convention the package gets used for toasts and the abstraction loses its value.

Migration path

  1. Inventory: grep for Action::modal('modal-response', withoutSyntaxHighlighting, and the legacy payload keys (body, code, html, highlight). Record every modal-returning action — that list is the QA scope.
  2. If Boost is present, upgrade Boost to ≥1.3.0 first.
  3. Bump the Composer dependency and re-publish/rebuild front-end assets in the same release. Never split these.
  4. Convert hand-built payloads to the ModalResponse/Block factory API rather than hand-authoring the new payload shape — hand-authoring is what broke, and the factory is the supported path.
  5. Add one golden-payload test asserting the emitted { title, size, closeButtonText, blocks: [...] } structure for a representative action. This is the single highest-leverage artifact from the whole upgrade: it is what prevents a future v3 from silently breaking modals again.
  6. Manual QA: open every modal-returning action in light and dark mode, including at least one nested collapsible and one tab set, with the browser console open watching for legacy-key warnings.

Compatibility

  • v2 is a breaking major for direct payload construction and the removed deprecated method; the fluent ModalResponse API is source-compatible. Most consumers are on the cheap path.
  • Pin the rollback target (v1.3.0) in the release notes before merging.
  • No known conflicts with Nova itself beyond the asset-republish requirement; verify the Nova major version in use against the package's supported range during the inventory step.

Sequencing

  • Step 1 (½ day, one engineer): inventory + decision gate — bump-only vs. scoped migration, and a named owner for assets.
  • Step 2 (1–2 days): upgrade in one PR with dependency, assets, payload conversions, and the golden-payload test together. QA in the same PR.
  • Step 3 (subsequent sprints): then spend the capability. Ship the highest-value read-only surfaces first — post-action diagnostics with copyable code/JSON, changelog and release-note modals, tabbed documentation, collapsible troubleshooting with runbook links. Deliver these as markdown/Blade composition, not custom modal UI.
  • Do not sequence adoption and upgrade in parallel across teams; get one app clean on v2 first, then the standard is proven and copyable.

Operational Impact

Maintenance

  • Near-zero ongoing cost. No config to drift, no migrations, no scheduled jobs, no external services. The maintenance surface is the Composer constraint plus whatever views/assets we publish.
  • The real maintenance obligation is the internal convention, not the code: keep the block vocabulary documented (a short internal page mirroring the skill/README), and keep the routing rule (message vs. download vs. redirect vs. modal) enforced in review. Without that, the API sprawls into ad-hoc HTML.
  • Own the golden-payload test as a living contract. It is the cheapest insurance against the next major.

Support

  • No vendor support, no SLA, no maintenance guarantee. Plan for self-sufficiency: one named engineer who can read the renderer and either patch a fork or replace it with Blade views. That person is the de facto owner; name them at adoption time.
  • Because the fallback is cheap, support risk is low but not zero — it is concentrated. If the owner leaves and nobody reads the block model, the admin panel accumulates modals nobody can safely change.
  • Escalation for a broken modal is cosmetic/functional within admin, not an outage. No on-call implication.

Scaling

  • Scales fine along the dimensions that matter here: number of actions returning modals, number of blocks per modal, number of admin users. It is server-rendered JSON plus a client renderer — no per-request backend cost beyond building the payload.
  • What does not scale is content discipline. Large Blade view blocks or heavy JSON payloads shipped into a modal will feel sluggish; keep modal payloads small and link out for anything large. Set that expectation early.
  • Zero dependents today means no upstream community pressure on compatibility — we absorb major-version churn ourselves. Budget one small upgrade item per major release rather than assuming ecosystem coordination.

Failure modes

  • Silent degradation (highest): v1-shaped payload against v2 renderer → empty or partial modal, only a console warning. Detection: golden-payload test + manual QA; add a console-error check to the QA checklist.
  • Stale assets: dependency bumped, assets not rebuilt → broken or blank modals. Prevention: atomic release, no split PRs, post-deploy smoke check on one modal per environment.
  • Unsanitized content: markdown/html/view blocks with untrusted input → script injection into the admin panel. Prevention: the convention above, plus code review attention on any view block whose data originates from request input or a model field an end user can write.
  • Ownerless customization: published views diverge from upstream, next upgrade is a manual diff with no owner. Prevention: prefer not publishing views at all; if we must, record it and assign the owner in the same change.
  • Scope creep toward interactivity: someone requests a form in the modal and it gets bolted on. Prevention: state the boundary explicitly in the internal docs — interactive means build, not configure.

Ramp-up

  • Engineer ramp-up is genuinely small: the fluent API reads conventionally, and the skill/README covers single-block factories, stack(), and the block catalogue. An engineer unfamiliar with the package can ship a first rich modal in under an hour.
  • Product/design ramp-up is the slower part: knowing which outcomes deserve a modal and which block composition fits. Seed that with two or three reference examples in the internal docs — a diagnostics modal with inline + badge + code, a changelog modal with heading + list + divider, a troubleshooting modal with collapsible + link — and teams will pattern-match rather than invent.
  • Onboarding cost for the upgrade specifically: 0.5–1.5 dev-days plus QA, plus ~1 day if views/assets are published. Size it, assign it, and close it — do not leave it open as ambient tech debt, because the failure mode is invisible until someone opens a modal.
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.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource