FilamentF
Filament2y ago
Abi

`EditAction` and `DeleteAction` on a ViewRecord's `getHeaderActions` method throws an error

I have the following ViewRecord page for a resource and adding HeaderActions EditAction and DeleteAction throws an error.

use App\Filament\Resources\Store\StoreResource;
use Filament\Resources\Pages\ViewRecord;
use Filament\Actions;

class ViewStore extends ViewRecord
{
    protected static string $resource = StoreResource::class;

    protected function getHeaderActions(): array
    {
        return [
            Actions\EditAction::class,
            Actions\DeleteAction::class,
        ];
    }


Error

Header actions must be an instance of Filament\Actions\Action, or Filament\Actions\ActionGroup.


Any advice.
Solution
actually figured it out just now after looking at the docs. need to call the make() method for the class

replaced my code with and it worked

Actions\EditAction::make(),
Actions\DeleteAction::make(),
Was this page helpful?