Open danielschweiger opened 2 years ago
We're not sure at the moment and we haven't upgraded / bought a license for Nova 4 ourselves yet.
I think the most likely parts to break would be the ones that assume Nova internals like:
In case anyone else is wondering on how to use dynamic actions in Nova v4:
You don’t need any third party package, it can be done out of the box:
In nova v4 actions can be one of the following types:
normal
- actions performed against single or multiple resources/modelssole()
- actions performed only on a single resource/modelstandalone()
- actions performed on no specific resource/model -> doesn’t make sense to have dynamic fields hereNormal actions
If your action fits into the normal
use case, you just have to return an empty array when no resources are included in the request (no clue why this is requested on an initial load from nova)
public function fields(NovaRequest $request): array
{
if (!$posts = $request->selectedResources()) {
return [];
}
// return the fields
}
Sole actions
Sole actions are even simpler, since nova is only doing a request when one resource gets selected, you can use the findModel()
method on the NovaRequest
to get your model
public function fields(NovaRequest $request): array
{
// query your specific models
$posts = $request->findModel();
// return the fields
}
—
EDIT:
It looked like it works the way I described above only when not using the ->showInline()
method. Hence, this package might still be able to add some value
Will this work with Nova 4?