© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
5 replies
bowett.

Pass query string parameters to Table Builder in v3

Hi, this is the first question I've asked. I feel like I may be missing something so apologies but I have searched and looked at the docs before asking.

I'm trying to pass a query string parameter to a page using Table Builder. For example, if I have a table of cities in the USA which simply contains:

The name of the City
The State the City is in.

I want to set up a page with a route:

/cities/{state}

If I visit /cities/Florida then I get a page of all the cities in Florida.

I've tried doing this by adding a mount function to my Livewire component:

public function mount($state)
    {
        $this->state = $state;
    }
public function mount($state)
    {
        $this->state = $state;
    }


I then use this in my table function:

return $table
            ->query(City::where('state', $this->state))
return $table
            ->query(City::where('state', $this->state))


This works initially. The problem is if I then try to sort by a column or search inside that table I get an error:

local.ERROR: Property [$state] not found on component.
local.ERROR: Property [$state] not found on component.


I think this is because the mount method is not called when the component re-renders.

How should I structure this query so it works?
Solution
I found the issue and it was something small. I forgot to declare the variable inside the component:

'public $state;'

It's working as expected now. Sorry for wasting everyones time.
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

How to use "tableSearch" query string in table builder?
FilamentFFilament / ❓┊help
3y ago
Trouble in traslation: pass query parameters
FilamentFFilament / ❓┊help
13mo ago
Menu builder in v3
FilamentFFilament / ❓┊help
3y ago
Delete action in table builder V3 seems to ignore Policy
FilamentFFilament / ❓┊help
3y ago