- What is beyondcode/nova-custom-dashboard-card used for?
- It is a small Laravel Nova card package that lets you render fully custom dashboard cards from Blade views instead of writing a Vue component for every card. The card class delegates rendering to a globally registered Vue component that receives a component name and serialized payload, so you can add bespoke HTML, KPIs, links, and actions alongside Nova metrics. It is an archived 2018 package built for Nova 1.x/2.x and Vue 2, so treat it as a reference implementation rather than a drop-in dependency for current Nova.
- How do I install and register the card in Laravel Nova?
- On a legacy Nova 1.x or 2.x install, install it with Composer using composer require beyondcode/nova-custom-dashboard-card, then register the card through Nova's standard cards workflow in your NovaServiceProvider. You also need to ensure the package's Vue component is registered in Nova.booting and rebuild assets with npm run dev. Because the package is archived, verify the exact component name and registration steps against the source before adopting it.
- Does it work with Nova 3 or Nova 4?
- No. The package targets Nova 1.x and 2.x with a Vue 2 toolchain and was last released in August 2018. Nova 3+ introduced API drift, and Nova 4+ ships native multiple dashboards through Nova::dashboards(), which covers most custom dashboard needs with supported code. On a current Nova install the practical path is to read it and rebuild the pattern in-house, not install it.
- Can I render a Blade view as a Nova dashboard card?
- Yes, that is the package's main purpose: generate a card, point it at a Blade view, and render your own HTML, data, or quick actions on the Nova dashboard. The PHP card supplies a component name and payload to a thin Vue wrapper, but the content you author can live in Blade. You still need a working Nova card registration and asset build for the target Nova version.
- How do I pass data into a custom dashboard card?
- Use the card's withData() method to pass an array of values through to the card's view or component. Be careful not to serialize full Eloquent models, because that exposes more attributes than you may intend; pass explicit arrays or selected columns instead. Also remember that inner cards built in PHP do not re-evaluate their own canSee() checks, so authorization must be enforced where the child data is constructed.
- How do I change the width of a Nova custom dashboard card?
- Use Nova's standard card width configuration on the card instance, such as width('1/2') or the full-width option supported by your Nova version, to control how it sits in the dashboard grid. The package does not add a separate layout engine, so layout behavior follows Nova's card contract. Confirm the exact width values for your Nova major version, since the API changed across releases.
- Is beyondcode/nova-custom-dashboard-card maintained and production-safe?
- It is not actively maintained: the repository is archived, the last release was 2018-08-22, and it has no security response or compatibility releases. That makes it a poor fit for a current production Nova install, especially if the dashboard exposes customer or tenant data. If you must use it on a legacy admin, vendor it under your namespace, pin the Composer version, and keep a rollback copy.
- How do I handle authorization with custom dashboard cards?
- Inner cards built in PHP inside a custom card do not automatically re-evaluate their own canSee() authorization, so you must enforce access where the child card array or data is built. Also audit what withData() sends to the front end, because serialized Eloquent models can leak attributes. Test visibility per user role and avoid assuming Nova's outer card authorization covers nested content.
- How do I test a custom Nova dashboard card?
- Test the card like any Nova customization: assert that the card is registered on the dashboard, unit test the data array you pass to withData(), and feature test the dashboard endpoint as different users. Because authorization on inner cards is not re-evaluated, add explicit tests for the code that builds child cards or scopes queries. On a legacy install, also smoke test the compiled Vue assets after any Nova or Laravel upgrade.
- What are the alternatives or migration path for modern Nova dashboards?
- For modern Nova, use Nova 4+ native dashboards via Nova::dashboards() or build a first-party card under your own namespace instead of installing this archived package. If you are on a legacy Nova 1.x/2.x admin that you are not upgrading this cycle, you can vendor and pin the package, subclass CustomDashboardCard to add fluent setters, and document an exit criterion. If you fork it, budget the Vue 2 to Vue 3 rebuild separately from the PHP side.