Skip to content

Attribute with name length is not giving the desired output when using ->searchable(isIndividual: true) #15073

@Geoffry304

Description

@Geoffry304

Package

filament/filament

Package Version

v3.2.130

Laravel Version

v.11.35.0

Livewire Version

No response

PHP Version

PHP 8.3

Problem description

When you have an attribute named length in the database and you use the ->searchable(isIndividual: true) in the tables of filament you get a zero in the search field and the search field is not working. When deleting the zero to filter, the zero keeps coming back.

image

Expected behavior

That the zero is not there and that I am able to filter individual on an attribute named length.

Steps to reproduce

  1. Create a table with a column that is named length with type integer or float
  2. Create a standard resource of the model
  3. Make the column length individual searchable
public static function table(Table $table): Table
    {
        return $table
            ->columns([
                Tables\Columns\TextColumn::make('id')
                    ->label('ID'),
                Tables\Columns\TextColumn::make('length')
                    ->suffix(' mm')
                    ->searchable(isIndividual: true)
                    ->sortable(),
                Tables\Columns\TextColumn::make('total_meters')
                    ->suffix(' m')
                    ->sortable(),
                Tables\Columns\TextColumn::make('supplier_reference')
                    ->label('Reference')
                    ->sortable(),
            ])
            ->filters([
                //
            ])
            ->actions([
                Tables\Actions\EditAction::make(),
            ])
            ->bulkActions([
                Tables\Actions\BulkActionGroup::make([
                    Tables\Actions\DeleteBulkAction::make(),
                ]),
            ]);
    }

Reproduction repository (issue will be closed if this is not valid)

https://github.com/Geoffry304/filament-length-attribute-issue

Relevant log output

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    Todo

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions