nova-button
nova-button copied to clipboard
Button on resource with custom indexQuery with grouped results failed
Hello,
I have built a custom resource page and want to attach your button to link to a controller (or anywhere really). I am getting a 404 not found error because resourceId is null :
/nova-vendor/nova-button/<resource name>/null/text 404 (Not Found)
resourceId is null because each row on this resource is a group of a bunch of rows combined together (i.e. 10 Cars of this model).
Is there a workaround to this dependency? For example I cant even use the button to create a link to an external website because of this dependency.
Right now if I change this line in src/Http/Controllers/ButtonController.php from :
$resource = $request->findModelQuery()->firstOrFail();
to :
$resource = $request->findModelQuery()->first();
The issue doesnt happen anymore