Filament Page with Table

Hello, I have a model that has a HasMany(ModaliyYear) relationship and this model(ModaliyYear) has a HasMany(ModalityAttachment) relationship and I created a custom page to list/create the attachments, but I'm not getting it

Error
Filament\Tables\Table::make(): Argument #1 ($livewire) must be of type Filament\Tables\Contracts\HasTable, App\Filament\Resources\ModalityResource\Pages\ModalityAttachments given, called in /var/www/vendor/filament/tables/src/Concerns/InteractsWithTable.php on line 241


Code
<?php

namespace App\Filament\Resources\ModalityResource\Pages;

use App\Filament\Resources\ModalityResource;
use Filament\Resources\Pages\Concerns\InteractsWithRecord;
use Filament\Forms\Components\Builder;
use Filament\Forms\Components\View;
use Filament\Resources\Pages\Page;
use Filament\Tables\Actions\Contracts\HasTable;
use Filament\Tables\Columns\TextColumn;
use Filament\Tables\Concerns\InteractsWithTable;
use Filament\Tables\Table;

class ModalityAttachments extends Page implements HasTable
{
    use InteractsWithRecord, InteractsWithTable;

    protected static string $resource = ModalityResource::class;

    protected static string $view = 'filament.resources.modality-resource.pages.modality-attachments';

    public function table(Table $table) : static
    {
        return $table
            ->columns([
                TextColumn::make('year')
            ]);
    }

    public function mount(int | string $modality, int | string $record): void
    {
        $this->record = $this->resolveRecord($record);
    }

}
Was this page helpful?