Closed wamesro closed 1 year ago
It still doesn't work. Is there a proven procedure?
Have You installed the current Version?
Action Code:
https://github.com/Muetze42/laravel-nova-demo-app/blob/main/app/Nova/Actions/RadioAction.php
Action on index: https://nova-demo.huth.it/resources/nova-radio-field-radios
Action on detail: https://nova-demo.huth.it/resources/nova-radio-field-radios/1
I have already discovered the problem
This is how it works
public function actions(NovaRequest $request): array
{
return [
new ProductVariantExpedition()
];
}
and when using Inline Actions it shows as Select https://nova.laravel.com/docs/4.0/actions/registering-actions.html#inline-actions
public function actions(NovaRequest $request): array
{
return [
(new ProductVariantExpedition())->showInline()
];
}
Strange. For me it also works with showInline()
Can you test what happens when you add this method to the package file src/Radio.php
?
class Radio extends Select
{
// ...
protected function isAction(): bool
{
if (!isset($this->isAction)) {
$this->isAction = str_ends_with($this->getRequest()->path(), '/actions') || str_ends_with($this->getRequest()->path(), 'nova-api/nova-radio-field-radios');
}
return $this->isAction;
}
// ...
}
It only works for bulk actions after checking the checkbox on the left, but after clicking on the 3 dots it is still Select
It works the same way in your demo https://nova-demo.huth.it/resources/nova-radio-field-radios
https://github.com/Muetze42/nova-radio-field/assets/5340873/c2662187-6682-41f4-928d-ac413776479a
Ah. I see. The action path is not used there at all.
I'll have to think of something else. I guess I'll have to rewrite it so that the select is not used for detail & index.
But will be something only tonight.
Alright, good luck ;-) but it's a great package
I was surprised that there is no radio field. Then I thought to myself, that is quickly done. But first that with dependsOn
, then with the filters. If I had known that before. 😂
Great, now it works in action as well
laravel/nova
: 4.24.3norman-huth/nova-radio-field
: 1.1.6When used in action, the radio field is displayed as Select
php artisan nova:action RadioExampleAction