FilamentF
Filament3y ago
btx

Undefined variable $table while using table builder

Following this tutorial: https://filamentphp.com/docs/2.x/tables/getting-started#preparing-your-livewire-component
Im getting the error message: Undefined variable $table.

<?php

namespace App\Forms\Components\MemberPayment;

use App\Models\MemberPayment;
use Filament\Forms\Components\Component;
use Illuminate\Support\Collection;
use Filament\Tables;
use Illuminate\Contracts\View\View;

class MemberPaymentListComponent extends Component implements Tables\Contracts\HasTable  {
   use Tables\Concerns\InteractsWithTable;

   protected string $view = 'forms.components.member-payment.member-payment-list-component';

   /** @var Collection|MemberPayment[]  */
   protected Collection $items;

   public static function make(): static {
      return new static();
   }

   public function items(Collection $items): static {
      $this->items = $items;

      return $this;
   }

   /**
    * @return Collection|MemberPayment[]
    */
   public function getItems(): Collection {
      return $this->items;
   }
}
image.png
Was this page helpful?