F
Filament15mo ago
Jordy

ListsRecord\Tab deprecation

I am using tabs in my resource like the orders page does in the demo (https://github.com/filamentphp/demo/blob/678ef5c53f219a2032c0ae70fd5b5e7d3cfeb9b5/app/Filament/Resources/Shop/OrderResource/Pages/ListOrders.php#L31C6-L31C6) but I get a warning it is deprecated and to use the Components/Tab.. but this does not have the query functionality.. am I supposed to fetch the active tab in the resource from now on or will this functionality come to the default tab? If so, will the demo be updated too? (I am fine with opening a pr).. I am sure more people look at the source code for inspiration like I did ^^
6 Replies
Jordy
JordyOP14mo ago
I dont like bumping questions but I kinda need an anwser 🙈 lol
Lara Zeus
Lara Zeus14mo ago
just change the imported class
use Filament\Resources\Components\Tab;


public function getTabs(): array
{
return [
null => Tab::make('All'),
//....
];
}
use Filament\Resources\Components\Tab;


public function getTabs(): array
{
return [
null => Tab::make('All'),
//....
];
}
LeandroFerreira
LeandroFerreira14mo ago
yes, use Filament\Resources\Components\Tab
Jordy
JordyOP14mo ago
and resolve the active tab from the url? I need the query() functionality
Lara Zeus
Lara Zeus14mo ago
still you can do Tab::make('All')->query(),
Jordy
JordyOP14mo ago
hm, it was not there at work but on a different project now.. will try running composer update to see if that fixes the issue

Did you find this page helpful?