gobrightspot / nova-detached-actions

A Laravel Nova tool to allow for placing actions in the Nova toolbar detached from the checkbox selection mechanism.
MIT License
168 stars 50 forks source link

Reload resource after action is executed #20

Closed sdapkus closed 4 years ago

sdapkus commented 4 years ago

I'm using this package to have ability to create a multiple resources at one (I have only one field that user needs to fill in, so I'm giving user text area, and later exploding text, and just saving all content). Issue that I have currently is that after saving is done, resource page is not updated, so I'm still looking at old resource, and I need manually reload page to see new data.

It would be nice to have option, where I could set, that after action is done, reload resource data.

eoghanobrien commented 4 years ago

That's a common request on Nova I believe, I think that would be handled inside the Nova Action rather than in our package.

Could you use a Redirect Response like Action::push to redirect to the same page?

sdapkus commented 4 years ago

If I use Action::push it does not do anything, because I'm already in a route that I'm passing (because I'd like to refresh same page). From docs you linked, only solution would be to use Action::redirect but this one will refresh whole page, rather than only resource place

eoghanobrien commented 4 years ago

Yeah, I think you're correct. Based on my research I don't see a way to handle that within Nova. It would make a great suggestion over on the nova-issues repo.

Check out standalone actions in today's Nova release. It looks like it might be a better option than our package. Always nice to use first party solutions.

eoghanobrien commented 4 years ago

Hi, I've figured this out and will release a new version with this feature soon.