Select filter throwing error when using relationship

\Filament\Tables\Filters\SelectFilter::make('user_id')
                    ->relationship('user', 'name')

This is my code and this gives error https://flareapp.io/share/w5BnMJv5#context-app-views . This is working in all my other resources except for this one. If I use any other filed like id or phone or anything else it takes a lot to load and crashes my whole application. But if I do

->relationship(
    name: 'user',
    titleAttribute: 'name',
    modifyQueryUsing: fn(Builder $query) => $query->has('productSlug'),
)
this works. Am I suppose to do it like this ? Also, when I use relationship in other resources as well, it gives all data not the relationships one.
Flare
Filament\Forms\Components\Select::isOptionDisabled(): Argument #2 ($label) must be of type string, null given, called in /Users/namrata/ug/backend/storage/framework/views/ccaf1eba786fda1c93f5e422c4e8cc96.php on line 86 - The error occurred at http://backend.test/admin/product-slugs
Solution
Ok thank you
Was this page helpful?