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

joerithegreat/nova-table-card

joerithegreat/nova-table-card adds a configurable table card to Laravel Nova dashboards, letting you display query results or metrics in clean columns with custom formatting. Surface key records and stats at a glance without building a custom card.

View on GitHub
Deep Wiki
Context7

Getting Started

This is a Laravel Nova card package: it renders a table (columns + rows you supply) inside a standard Nova card, so you can surface arbitrary tabular data on a dashboard or resource detail page without building a custom Vue component. Release 1.1.0 adds Nova 5 support, so the package now spans Nova 4.x and 5.x.

Minimal steps:

  1. composer require whitespacecode/nova-table-card — confirm the resolved version supports your Nova major (1.1.0+ for Nova 5, 1.0.x if you are still on Nova 4).
  2. No asset publishing step is normally required; Nova cards ship pre-built assets in dist/. Run php artisan nova:publish only if you are overriding the card's frontend.
  3. Register the card in a dashboard's cards() method (e.g. app/Nova/Dashboards/Main.php) or in a Resource's cards() method.
  4. Check the package README first for the exact fluent API (columns(), rows()/data(), title()) — that surface, not the Nova wiring, is where the package's own conventions live.
  5. First use case: a "Latest signups" or "Queue health" table on the main dashboard — small, read-only, no Nova resource needed behind it.

Implementation Patterns

Dashboard card with a query-backed table. The natural pattern is to resolve the card's rows from a query inside the card definition (or a small dedicated class/method), keeping the card itself thin:

public function cards(): array
{
    return [
        (new TableCard)
            ->title('Latest Orders')
            ->width('1/2')
            ->columns([...])
            ->rows(Order::latest()->take(5)->get()->map(fn ($o) => [...])->all()),
    ];
}

Resource detail cards. Use the same card inside a Resource's cards() when the table is scoped to the record being viewed ($this->resource is available via NovaRequest). This is the cleanest way to show related rows — e.g. recent invoices for a customer — without defining a whole index-style relationship.

Extract data into a dedicated provider. Rather than inlining a query in cards(), put it in an invokable class (App\Nova\Cards\LatestOrders) that returns the configured card. This keeps dashboards declarative, makes the table reusable across dashboards, and gives you an obvious place to add caching.

Pair with Nova's authorization helpers. Cards render for anyone who can see the dashboard, so gate sensitive tables with ->canSee(fn (Request $request) => $request->user()->isAdmin()) and/or the card's canSeeWhen equivalent.

Cache the heavy bits. Dashboards render on every page load of /nova. Wrap aggregate queries in Cache::remember(..., 60, ...) and, if the package supports it, use the card's refresh/auto-refresh option rather than recomputing per request.

Layout composition. Treat these as half- or third-width cards alongside Nova metrics and trend metrics; they read well as a drill-down companion to a metric above them.

Gotchas and Tips

  • Nova version alignment is the main upgrade risk. 1.1.0's only change is Nova 5 support; if you are on Nova 4, stay on the 1.0.x line unless the changelog says 1.1.0 is backward compatible. Pin explicitly ("whitespacecode/nova-table-card": "^1.0" vs "^1.1") rather than floating, and verify composer why laravel/nova after upgrading.
  • N+1 and unpaginated queries. If the card accepts an Eloquent query or a closure, verify when it is evaluated — a table card that runs an unbounded get() on a large table will slow every dashboard load. Always take()/limit() and eager-load relationships.
  • No pagination or sorting by default. These cards are display-only. If users need to sort/filter, link the card title (or a row link) to the relevant Nova resource index instead of trying to add interactivity.
  • Serialization surprises. Rows are serialized to JSON and handed to the card's Vue component. Carbon instances, enums, and models placed directly in rows may render oddly or leak attributes — map to plain strings/arrays (and explicitly pick columns) before returning.
  • Dark mode and long values. Check the card in Nova's dark theme and with a long text/email column; tables inside a narrow card truncate or overflow. Prefer few columns and short values, and put the full value in the resource link.
  • Caching after Nova 5 upgrade. Nova 5 changed frontend asset compilation and some card behaviour; after upgrading, run php artisan nova:publish --force if you had published this card's assets, and clear compiled views/nova-components caches if the card renders blank.
  • Blank card usually means data, not the package. If the card renders empty, dump the resolved rows in a Tinker/route context first; the common causes are a canSee closure returning false, an empty collection from a query scoped by a NovaRequest filter, or rows being an array of objects rather than arrays.
  • Extension point. For anything beyond static tables — inline editing, per-row actions, exports — stop stretching this card and switch to a custom Nova tool or field; the card is intentionally a presentational wrapper.
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.
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons