FilamentF
Filament2y ago
Pscl

Adding Custom Action to TopBar

Hey all,

//AppServiceProvider.php

FilamentView::registerRenderHook(
            PanelsRenderHook::GLOBAL_SEARCH_AFTER,
            function () {
                $action = Action::make('sendIdea')
                    ->label('moep')
                    ->form([
                        TextInput::make('subject')->required(),
                        // RichEditor::make('body')->required(),
                    ])
                    ->action(function (array $data) {
                        // Handle the action logic here
                        dd($data);
                    });

                return view('components.send-idea-button', compact('action'));
            }
        );

//send-idea-button.blade.php
<div>
    {{ $action }}
</div>


The button is displayed at topbar, but the magic of opening the form is not happening.

Which piece of the puzzle am I missing? Thanks for support!
Was this page helpful?