© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•9mo ago•
5 replies
Xavi

How to pass parameter to list page

I want to pass channel paramter and get on list.. i add here

public static function getPages(): array
    {
        return [
            'index' => Pages\ListMessageImap::route('/{channel}'),
            'create' => Pages\CreateMessageImap::route('/create'),
            'edit' => Pages\EditMessageImap::route('/{record}/edit'),
        ];
    }
public static function getPages(): array
    {
        return [
            'index' => Pages\ListMessageImap::route('/{channel}'),
            'create' => Pages\CreateMessageImap::route('/create'),
            'edit' => Pages\EditMessageImap::route('/{record}/edit'),
        ];
    }

and pass like this

NavigationItem::make($channel->name)
                        ->group('Channels')
                        ->url(fn(): string => route('filament.user.resources.message-imaps.index', [
                                'tenant' => Filament::getTenant(),
                                'channel' => $channel->id]
                        ))
                        ->icon('heroicon-o-envelope-open');
NavigationItem::make($channel->name)
                        ->group('Channels')
                        ->url(fn(): string => route('filament.user.resources.message-imaps.index', [
                                'tenant' => Filament::getTenant(),
                                'channel' => $channel->id]
                        ))
                        ->icon('heroicon-o-envelope-open');


and on list, i add this

class ListMessageImap extends ListRecords
{
    protected static string $resource = MessageImapResource::class;

    #[Url]
    public string $channel;

    protected function getHeaderActions(): array
    {
        return [
            Actions\CreateAction::make(),
        ];
    }

    protected function getTableQuery(): ?Builder
    {
        return Message::query()
            ->where('channel_id', $this->channel);
    }
} 
class ListMessageImap extends ListRecords
{
    protected static string $resource = MessageImapResource::class;

    #[Url]
    public string $channel;

    protected function getHeaderActions(): array
    {
        return [
            Actions\CreateAction::make(),
        ];
    }

    protected function getTableQuery(): ?Builder
    {
        return Message::query()
            ->where('channel_id', $this->channel);
    }
} 


but it doesnt works. Any ideas?

Thanks!
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Pass URL parameter from Page to Widget
FilamentFFilament / ❓┊help
2y ago
How to pass parameter to custom middleware?
FilamentFFilament / ❓┊help
2y ago
How to create custom list page?
FilamentFFilament / ❓┊help
3y ago
Pass value from Modal form to Action on list page
FilamentFFilament / ❓┊help
3y ago