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 Card Html Laravel Package

gabrielesbaiz/nova-card-html

A lightweight Laravel Nova card that lets you render custom HTML directly in your dashboard. Drop in raw HTML snippets, embeds, or simple widgets without building a full Vue component—just point the card at your content and it displays wherever you place it.

View on GitHub
Deep Wiki
Context7

Getting Started

  • Install with composer require gabrielesbaiz/nova-card-html and verify the constraint matches your Nova major (v3 likely targets Nova 5 / Laravel 11+; check composer.json after install).
  • Register the card in app/Nova/NovaServiceProvider.php inside cards() for dashboards, or in a resource’s cards() method for per-resource placement.
  • Minimal first use case: render a static “help / links” card on the dashboard. Instantiate the card, pass an HTML string or view, and give it a title and width.
// NovaServiceProvider::cards()
(new \Gabrielesbaiz\NovaCardHtml\Card)
    ->title('Quick Links')
    ->html('<a href="/nova/resources/users">Users</a> · <a href="/nova/resources/roles">Roles</a>')
    ->width('1/3'),
  • Where to look first after install: the package README, src/ card class for the exact fluent API (html(), view(), withMeta()), and the compiled JS in dist/ to confirm the component is registered.

Implementation Patterns

  • Dashboard documentation card: store long HTML in a Blade view and render it with the card’s view/data method rather than embedding huge strings in PHP. Keeps markup maintainable and lets you use Blade components.
  • Dynamic content via withMeta: pass computed values (counts, URLs, feature flags) into the card and interpolate them client-side or server-side, so the card stays reactive to Nova’s meta payload.
  • Authorization and visibility: use Nova’s standard card helpers—canSee(), canSeeWhen(), onlyOnDetail(), onlyOnIndex()—to prevent sensitive HTML from rendering for unauthorized users.
  • Layout control: set ->width('1/2'), '1/3', 'full' to slot the card into Nova’s dashboard grid; test at tablet/mobile widths because raw HTML often breaks Nova’s responsive columns.
  • Resource screen embedding: register the card in a resource’s cards() method to surface contextual HTML (e.g. external system links, onboarding instructions) on detail pages without writing a custom Vue component.
  • Composition with other cards: use the HTML card for static framing and keep metric/table cards for data. Avoid duplicating Nova’s built-in HelpCard / Markdown behavior unless you specifically need raw HTML control.

Gotchas and Tips

  • Major version bump = breaking changes. The 3.0.0 notes are only a changelog link, so read the full diff before upgrading. Likely breakpoints: minimum Nova/Laravel/PHP versions, renamed card class or namespace, changed registration signature, or dropped asset publishing.
  • XSS risk: this package renders raw HTML by design. Never interpolate user input without sanitizing (e.g. Purify, strip_tags allowlist). Prefer passing trusted Blade views over raw request data.
  • Escaping in PHP strings: quotes and </script> inside HTML strings are a common source of syntax errors. Use heredoc/nowdoc or Blade views for anything non-trivial.
  • Stale compiled assets: if the card renders blank after upgrade, run php artisan nova:publish and clear compiled views/cache; check that dist/js/card.js exists and is referenced by the service provider.
  • Debugging: inspect the network payload for the dashboard’s cards response to confirm meta is populated; use Vue devtools to see whether the card component mounted. If the card mounts but is empty, the issue is usually a meta key mismatch rather than the package.
  • Extension points: the card usually accepts a custom view via a view()/component() method—prefer that over forking the package when you need reusable markup. Keep custom views inside resources/views/nova/ and reference them with ->view('nova.my-card').
  • Version pinning: after confirming 3.0.0 works, pin ^3.0 in composer.json and note the Nova major in your upgrade docs, since Nova upgrades frequently require matching card releases.
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.
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect
youbar/easy-crud
c-point-labs/laravel-hostyourai
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo