mokhosh / filament-kanban

Add kanban boards to your Filament pages
https://filamentphp.com/plugins/mokhosh-kanban
MIT License
228 stars 32 forks source link

[Question]: How to use getHeaderActions #38

Closed willcastillo closed 2 months ago

willcastillo commented 2 months ago

What happened?

I'm trying to let the user toggle the visibility of the different statuses. In order to do this, I'm adding a "Toggle Columns" action in the header but I must be missing something. I keep getting a 404 when I click on the button.

Any idea what's going on?

protected function getHeaderActions(): array
    {
        return [
            CreateAction::make()
                ->form([

                ])
                ->action(function (array $data): void {
                    //
                })
            ,
        ];
    }

How to reproduce the bug

Not really a bug.

Package Version

2.8.0

PHP Version

8.2

Laravel Version

11.4

Which operating systems does with happen with?

No response

Which browsers does with happen with?

No response

Notes

No response

mokhosh commented 2 months ago

Can you please create a reproduction repo? I have boards with create actions and other actions without issues.

public array $statusesArray = [];

protected function statuses(): Collection
{
    return collect($this->statusesArray);
}

protected function getHeaderActions(): array
{
    return [
        \Filament\Actions\Action::make('add-status')
            ->action(function () {
                $this->statusesArray[] = [
                    'id' => 'something',
                    'title' => 'Something',
                ];
            }),
        CreateAction::make('create')
            ->model(static::$model)
            ->form([
                TextInput::make('name'),
            ]),
    ];
}
willcastillo commented 2 months ago

Thanks @mokhosh , please disregard. I was doing a findOrFail() in the boot (instead of mount()) that was messing everything up. Sorry for the noise! And thanks for this package.