->persistFiltersInSession() Issue in multitenant

->persistFiltersInSession() will persist the ->default() from one tenant to another. making it load the id which doesnt belong to the second tenant. Is there a way not to persist to another tenant?
No description
No description
2 Replies
Mikail
MikailOP7d ago
?? ??
toeknee
toeknee7d ago
What if you make the select a relationship, instead of your custom options. I just tried this... and we have persistFiltersInSession and cannot recreate it. The filters are not loaded into the next session.
Tables\Filters\SelectFilter::make('member_id')
->label('Member')
->placeholder('-- Filter by Member --')
->options(fn () => Member::withoutGlobalScopes(['active'])->get()->pluck('full_name', 'id')->toArray())
->default(550)
->query(fn (Builder $query, array $data) => $query->where('member_id', $data['value'])),
Tables\Filters\SelectFilter::make('member_id')
->label('Member')
->placeholder('-- Filter by Member --')
->options(fn () => Member::withoutGlobalScopes(['active'])->get()->pluck('full_name', 'id')->toArray())
->default(550)
->query(fn (Builder $query, array $data) => $query->where('member_id', $data['value'])),

Did you find this page helpful?