Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Geoffry304 opened this issue Dec 12, 2024 · 1 comment
Labels
Milestone

Comments

@Geoffry304
Copy link
Contributor

Geoffry304 commented Dec 12, 2024

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

Donate 💰 to fund this issue

  • You can donate funding to this issue. We receive the money once the issue is completed & confirmed by you.
  • 100% of the funding will be distributed between the Filament core team to run all aspects of the project.
  • Thank you in advance for helping us make maintenance sustainable!
Fund with Polar
@danharrin
Copy link
Member

Probably something to do with .length being a common property in JS land

@danharrin danharrin added this to the v3 milestone Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Todo
Development

No branches or pull requests

2 participants