pxlrbt/filament-excel

Method pxlrbt\FilamentExcel\Actions\Pages\ExportAction::table does not exist.

imbue opened this issue · 1 comments

imbue commented

Hi there! I am trying to use the page action to add export functionality to a resource, however I am experiencing some errors in the process. What am I doing wrong here?

<?php

use pxlrbt\FilamentExcel\Actions\Pages\ExportAction;
use pxlrbt\FilamentExcel\Columns\Column;
use pxlrbt\FilamentExcel\Exports\ExcelExport;

class OrderResource extends Resource
{

  // ...

  public static function table(Table $table): Table
  {
      return $table
          ->columns([
              Tables\Columns\TextColumn::make('id')->label('#'),
              Tables\Columns\TextColumn::make('case_number'),
              Tables\Columns\TextColumn::make('created_at')
                  ->dateTime()
          ])
          ->filters([
           
          ])
          ->headerActions([
              ExportAction::make()->exports([
                  ExcelExport::make()->withColumns([
                      Column::make('case_number')->heading('Case number'),
                      Column::make('created_at')->heading('Creation date'),
                  ]),
              ])
          ])
          ->actions([
              Tables\Actions\ViewAction::make(),
          ])
          ->bulkActions([
  
          ]);
  }
}

The above code snippet results in a BadMethodCallException Method pxlrbt\FilamentExcel\Actions\Pages\ExportAction::table does not exist. exception.

CleanShot 2023-06-20 at 00 00 45

Versions:

  • PHP 8.2.7
  • Laravel 10.13.5
  • Filament: 2.17.48
  • Filament Excel: 1.1.11
imbue commented

Never mind, obviously the PageAction is for Pages/ classes. Closing the issue!