marshmallow/nova-resource-click
Make Laravel Nova resource index rows clickable. Click anywhere on a row to open its detail page, with configurable behavior, without writing custom JavaScript. A small, focused Nova extension for faster navigation.
This package is small and archived, so the first step is to read the source before you install it — there is no meaningful documentation to fall back on.
src/ (the trait/abstract class and service provider), composer.json (Nova version constraints), and the README for a usage snippet. With 3 stars, 0 dependents, and an archived flag, you are effectively vendoring a snippet, not adopting a maintained dependency.dev-main change can't silently alter behaviour:
composer require marshmallow/nova-resource-click:"^1.0"
extra.laravel.providers in its composer.json).use Marshmallow\NovaResourceClick\ResourceClick;
class Invoice extends Resource
{
use ResourceClick;
// exact property/method name — verify in src/, this is the
// only thing you must get right before writing more code
public static $clickAction = 'edit'; // or a closure / custom URL
}
nova assets if the package ships JS: php artisan nova:publish && npm run dev in the Nova directory.First use case: make a row click open something other than the default Nova target — for example, a row that opens a custom detail page, a filtered lens, or an external link, while keeping the Edit/View buttons as explicit actions.
Before going further, check whether vanilla Nova already covers you. Nova exposes public static $clickAction on resources (edit, select, ignore) and per-field ->clickable(). If your requirement is one of those, you don't need the package at all.
Per-resource override. The natural pattern is a trait on each Resource with a static property or a clickAction() method returning one of a small set of targets. Keep the values centralized in constants or an enum in your app so the resource files stay readable.
Closure / computed targets. If the package supports a closure, use it for context-dependent rows — e.g. return the URL of a Lens or a related resource depending on status:
public static function clickAction(): mixed
{
return fn ($model) => $model->isDraft()
? "/resources/invoices/{$model->getKey()}"
: "/resources/invoices/{$model->getKey()}/edit";
}
Guard for null/soft-deleted models; a closure returning null typically degrades to "no action", which looks like a broken row to users.
Pair with navigation actions. Keep actions() and the row buttons functional. The click override is a convenience layer; users still expect the ⋯ menu and the View/Edit links to behave normally. Don't remove the ability to reach the detail page unless the click target is the detail page.
Authorization first. Whatever the click target, it must respect policies. If you route to a custom page, add the policy check in the controller/page, not only in the Nova resource — otherwise a click can 403 or, worse, leak data.
Global default vs. opt-in. Define one base Resource class (e.g. App\Nova\Resource) with the trait applied and a sensible default, then override only where needed. This keeps the change surface to one file when the package inevitably needs patching.
Testing. Nova index behaviour is hard to unit test; cover the underlying URL/authorization logic (the closure or method) with a plain PHPUnit test, and verify the actual click in the browser. Don't try to assert on Nova's Vue internals.
src/ fully, pin the version, and if it works, consider copying the trait into your own app namespace so you control it. Zero dependents means no community signal on breakage.$clickAction and index component internals changed across 4.x and 5.x. If you're on Nova 5, test on a branch — a stale trait can collide with the native property and be silently ignored.$clickAction and Nova also defines it, one wins depending on trait/property precedence. A trait property and a class static property of the same name is a fatal error in PHP — check this first if you get a white screen.select vs. navigation. Many teams want checkboxes and row clicks. Make sure the click target doesn't fire when the user clicks the checkbox or an action link — verify in devtools that the row handler isn't swallowing events.data-* attributes or an attached handler. If clicking does nothing, check the browser console first (a JS error in the published asset fails silently), then confirm assets were republished after install.php artisan nova:cache (or clear it) after changing the click target — Nova caches resource metadata and changes can appear to be ignored.target. If the action opens a new tab, ensure rel="noopener noreferrer"; the package likely doesn't handle this for you.Index component or a fieldsForIndex() override that renders a link field — more code, but fully supported and version-stable. Keep that in mind as the exit path when this package breaks.How can I help you explore Laravel packages today?