filament-export
filament-export copied to clipboard
Method App\Filament\Resources\UserResource\Pages\ListUsers::getCachedTableColumns does not exist.
Method App\Filament\Resources\UserResource\Pages\ListUsers::getCachedTableColumns does not exist.
I tried to run this but got an error,
app/Filament/Resources/UserResource/Pages/ListUsers.php
class ListUsers extends ListRecords
{
protected static string $resource = UserResource::class;
public ?string $tableSortColumn = 'created_at';
public ?string $tableSortDirection = 'desc';
// ....
}
If I comment out public ?string $tableSortColumn = 'created_at';
this, then the application is working.
This is an error in vendor/alperenersoy/filament-export/src/Actions/Concerns/HasRecords.php
protected function applySortingToTableQuery(Builder $query): Builder
{
/** @var \Filament\Resources\Pages\ListRecords $livewire */
$livewire = $this->getLivewire();
$columnName = $livewire->tableSortColumn;
if (!$columnName) {
return $query;
}
$direction = $livewire->tableSortDirection === 'desc' ? 'desc' : 'asc';
if ($column = $livewire->getCachedTableColumns()[$columnName]) {
$column->applySort($query, $direction);
return $query;
}
if ($columnName === $livewire->getDefaultSortColumn()) {
return $query->orderBy($columnName, $direction);
}
return $query;
}
Laravel v10 Filament v3 Livewire v3
Method App\Filament\Resources\UserResource\Pages\ListUsers::getCachedTableColumns does not exist.
I tried to run this but got an error,
app/Filament/Resources/UserResource/Pages/ListUsers.php
class ListUsers extends ListRecords { protected static string $resource = UserResource::class; public ?string $tableSortColumn = 'created_at'; public ?string $tableSortDirection = 'desc'; // .... }
If I comment out
public ?string $tableSortColumn = 'created_at';
this, then the application is working.This is an error in
vendor/alperenersoy/filament-export/src/Actions/Concerns/HasRecords.php
protected function applySortingToTableQuery(Builder $query): Builder { /** @var \Filament\Resources\Pages\ListRecords $livewire */ $livewire = $this->getLivewire(); $columnName = $livewire->tableSortColumn; if (!$columnName) { return $query; } $direction = $livewire->tableSortDirection === 'desc' ? 'desc' : 'asc'; if ($column = $livewire->getCachedTableColumns()[$columnName]) { $column->applySort($query, $direction); return $query; } if ($columnName === $livewire->getDefaultSortColumn()) { return $query->orderBy($columnName, $direction); } return $query; }
Laravel v10 Filament v3 Livewire v3
How did you install this packages' version for filament 3?
@lodekib add this in composer.json file.
"alperenersoy/filament-export": "^3.0@beta",
and then run composer update
for filament v3.
Hi, @faizananwerali , For me, doesn't work when export Table : League\Flysystem\Filesystem::has(): Argument #1 ($location) must be of type string, null given,
I have the same issue on
Laravel 10 Filament 3 Livewire 3
Is this still an unsolved?