I wanna add a dropdown to the panel header next to the user menu and then use the regular filament Actions (inside an ActionGroup). I know, that this is something similar to awcodes/filament-quick-create, but I need way more customization options.
I could get the dropdown/ActionGroup already working:
// Service provider register():
FilamentView::registerRenderHook(
PanelsRenderHook::USER_MENU_BEFORE,
fn (): string => Blade::render("@livewire('admin.quick-create-menu')"),
);
<!-- admin/quick-create-menu.blade.php -->
<div class="flex items-center gap-2">
{{ $quickCreateMenu }}
</div>
// QuickCreateMenu.php
class QuickCreateMenu extends Component implements HasActions
{
use InteractsWithActions;
public function render()
{
return view('livewire.admin.quick-create-menu', [
'quickCreateMenu' => ActionGroup::make([
Action::make("my-resource")
->label("Create my resource")
->url(route(...))
])
...
]);
}
}
This is already working. I can click on the ActionGroup-icon in the header, which opens the dropdown and then click on the "Create my resource" link which opens the Create-Page. So far, so good.
The problem comes with actions with modals. None of these actions are doing anything:
Action::make("xxx")
->requiresConfirmation()
->action(fn() => dd(1)),
Action::make("zzz")
->schema([
TextInput::make("test")
])
->action(fn($data) => dd($data))
Any ideas how to fix this?