undefined variable $activeTab in listPage Class

I am getting a error undefined variable $activeTab on the list page
<?php

namespace App\Filament\Resources\BookingResource\Pages;

use App\Filament\Resources\BookingResource;
use Filament\Actions\CreateAction;
use Filament\Resources\Pages\ListRecords;
use Filament\Resources\Pages\ListRecords\Tab;
use Illuminate\Database\Eloquent\Builder;

class ListBookings extends ListRecords
{
//public ?string $activeTab = 'active';
protected static string $resource = BookingResource::class;

public function getTabs(): array
{
return [
'all' => Tab::make(),
'active' => Tab::make(),
'inactive' => Tab::make(),
];
}

public function getDefaultActiveTab(): string | int | null
{
return 'active';
}

protected function getHeaderActions(): array
{
return [
CreateAction::make()->slideOver(),
];
}
}
<?php

namespace App\Filament\Resources\BookingResource\Pages;

use App\Filament\Resources\BookingResource;
use Filament\Actions\CreateAction;
use Filament\Resources\Pages\ListRecords;
use Filament\Resources\Pages\ListRecords\Tab;
use Illuminate\Database\Eloquent\Builder;

class ListBookings extends ListRecords
{
//public ?string $activeTab = 'active';
protected static string $resource = BookingResource::class;

public function getTabs(): array
{
return [
'all' => Tab::make(),
'active' => Tab::make(),
'inactive' => Tab::make(),
];
}

public function getDefaultActiveTab(): string | int | null
{
return 'active';
}

protected function getHeaderActions(): array
{
return [
CreateAction::make()->slideOver(),
];
}
}
this is my code any ideas?
Solution:
fixed in .58
Jump to solution
5 Replies
Romaldy
Romaldy10mo ago
the problem comes from the view itself, they should use $this->activeTab to access the variable. @Dan Harrin please see this issue.
No description
Dan Harrin
Dan Harrin10mo ago
ok
Solution
Dan Harrin
Dan Harrin10mo ago
fixed in .58
Romaldy
Romaldy10mo ago
thak you homie
nostrodamned
nostrodamned10mo ago
@romyblack. thanks for helping !