Hide "anonymous" actions in create page
Hello everyone... I added anonymous actions to show modal contains checkbox to generate PDF respective to the selected checkbox.
Currently the Action button "Print PDF" are available both in create & edit page. My question is
1. How can I hide the action button in create page and only show in edit page?.
-
->hiddenOn()
it will cause Method Filament\Forms\Components\Actions\Action::hiddenOn does not exist.
- ->hidden(function ( $state) { if (!$state) { return false; } })
it will show Typed property Filament\Forms\Components\Actions\Action::$component must not be accessed before initialization
2. How can I open new tab when the "Print PDF" Action Button is clicked?4 Replies
Solution
1 -
Actions::make([...])->hiddenOn('create')
ahaa.. My bad.. previously I add the hiddenOn inside the Action::make... Thank you
Next how can I open new tab when the action button is clicked?
Hum, not sure. Actions allow
->url(...)->openUrlInNewTab()
but I don't know if you can use itunfortunately the
->openUrlInNewTab()
not working with ->action()
. I ended download the pdf instead of viewing it in new tab.
UserResource.php
PdfController.php