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 Resource Click Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Getting Started

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.

  1. Skim the repository before requiring it: 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.
  2. Install with a pinned constraint so a future fork or dev-main change can't silently alter behaviour:
    composer require marshmallow/nova-resource-click:"^1.0"
    
  3. Register the service provider if the package doesn't use Laravel auto-discovery (check extra.laravel.providers in its composer.json).
  4. Apply it to one Resource and confirm behaviour in the Nova index:
    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
    }
    
  5. Refresh 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.

Implementation Patterns

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.

Gotchas and Tips

  • Archived and near-zero adoption. Treat every line as untrusted. Read 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.
  • Nova version drift. The package almost certainly targets Nova 3 or early 4. Nova's native $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.
  • Property name collision. If the package defines $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.
  • Debugging. Nova renders the index via Vue; inspect the row element in devtools for 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.
  • Caching. Run php artisan nova:cache (or clear it) after changing the click target — Nova caches resource metadata and changes can appear to be ignored.
  • External URLs and target. If the action opens a new tab, ensure rel="noopener noreferrer"; the package likely doesn't handle this for you.
  • Extension points. Rather than fighting the package, the robust escape hatch is a custom Nova 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.
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.
frankyso/ipaymu
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment