fix: pgsql exception in global search with periods in table names

This commit is contained in:
Lukas Mateffy
2025-07-08 13:48:28 +02:00
parent 324f1d9073
commit 24c97f178d
+4 -8
View File
@@ -163,15 +163,11 @@ if (! function_exists('Filament\Support\generate_search_column_expression')) {
{
$driverName = $databaseConnection->getDriverName();
if (Str::lower($column) !== $column) {
$column = match ($driverName) {
'pgsql' => (string) str($column)->wrap('"'),
default => $column,
};
}
$column = match ($driverName) {
'pgsql' => "{$column}::text",
'pgsql' => (string) str($column)
->explode('.')
->map(fn (string $part) => str($part)->wrap('"'))
->implode('.') . '::text',
default => $column,
};