Custom action in relation manager
Hello - is it possible to pass a parameter in a custom action in a relation manager table?
I can use a custom action without a parameter. When I add the record ID as a parameter I see two requests but neither one seems to work
4 Replies
You return a string? Put your logic into the callback and it should work
Oh ok
So I can't pass it to a different function? It all has to be done in the callback?
A different function can also be a callback.
If you use PHP8.1 you can use the new callable syntax: https://www.php.net/manual/en/functions.first_class_callable_syntax.php
E.g.
->action(YourResource::refundItem(...))
Works perfectly
Thank you!