Cannot search by table columns with same name but one is from relation

Hello I have a table with 2 columns First is the resource name, second is the related customer name. On both I have used ->searchable() . So If I search by resource name the filter works but it works only for the resource name. Even if you comment out first column name and try to search for customer it will continue search only for the resource name. SQL query does not change at all. Always search in the first column name of the resource.
First column name of the resource is json but it think this is irrelevant for the issue.
If I change customer.name to customer.phone search starts working as usual for both fields.
Any ideas how to fix it?

 return $table
            ->columns([
                Tables\Columns\TextColumn::make('name')
                    ->searchable()
                    ->sortable(),
                Tables\Columns\TextColumn::make('customer.name')
                    ->searchable()
                    ->sortable(),


Bonus Q: how you handle search in json fields, because it differs from normal fields (because of lower) and this can lead to confusion when working with the product.
Was this page helpful?