Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Merklin's avatar

Need some help to make Filament table filters dependant to each other

Hello. I've been struggling with this for some time. I have a Task model, that has following relations:

public function project(): BelongsTo
    {
        return $this->belongsTo(Project::class);
    }

    public function createdBy(): BelongsTo
    {
        return $this->belongsTo(User::class, 'created_by');
    }

    public function reviewer(): BelongsTo
    {
        return $this->belongsTo(User::class, 'reviewer_id');
    }

For the current user, I am showing his tasks via this Livewire component:

And the table and filters that come from the TaskResourceTrait

What I'd like to achieve is that when a filter is changed (an option or options are selected), the choices for the rest of the filters are reduced to show only the available pairs. For example, now, from a total of 300 tasks, if I choose a created_by, there are only 11 tasks and 2 reviewers for those tasks, but the reviewer filter still shows all the reviewers for the 300 tasks, not the current filtered 11.

P.S.: The reason for the if/else in the filters is that I am using the same trait to generate a table for the front end (no panel defined) and for the Admin panel. My goal is to make the filters dependent on the front end, but if the solution can be applied for both cases even better.

0 likes
0 replies

Please or to participate in this conversation.