-
Notifications
You must be signed in to change notification settings - Fork 50
How to get resourceId from detached action from details? #32
Comments
@4n70w4
|
Hi, same issue for me here, I was able to get the item in a similar way than @4n70w4 by checking request params, but it doesnt work with this plugin. @Lai0n I tried your solution but the resources list contains all items, not only the one currently displayed in to detail view EDIT : When manually changing the source code of CustomDetailToolbar.vue, adding data to override the "selectedResources" to the intended ID instead of the default "all", it works : the ?Collection $resources you mentioned then only contains the resource we want . The way I get the resourceID is a bit hacky, but I can be a lead to a more elegant solution CustomDetailToolbar.vue data: function () {
var resourceId = null;
var currentComponent = this;
do {
resourceId = currentComponent.$props.resourceId;
currentComponent = currentComponent.$parent;
} while (currentComponent && !resourceId);
return {
visibleActionsDefault: 3,
actionsList: [],
selectedResources: resourceId || 'all',
confirmActionModalOpened: false,
invisibleActionsOpen: false,
} |
Potential temporary workaround is to use If using spatie/url then this works:
|
skar-helper |
Hi! I define action:
How to get resource Id in
ScriptCreate::handle
?request()->all()
contains:The text was updated successfully, but these errors were encountered: