mirror of
https://github.com/filamentphp/filament.git
synced 2026-09-24 15:42:09 +08:00
fix: pgsql exception in global search with periods in table names
This commit is contained in:
@@ -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,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user