Power-Components / livewire-powergrid

⚡ PowerGrid generates modern, powerful and easy-to-customize data tables using Laravel Livewire.

Home Page:https://livewire-powergrid.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dynamic filter missing the key property

Epitaffio opened this issue · comments

Have you searched through other issues to see if your problem is already reported or has been fixed?

Yes, I did not find it.

Did you read the documentation?

Yes, I did not find it.

Have you tried to publish the views?

No, this error is not related to views.

Is there an error in the console?

No

PHP Version

8.1

PowerGrid

5.4.2

Laravel

10.46.0

Livewire

3.4.6

Alpine JS

No response

Theme

Tailwind 3.x with tailwind/forms

Describe the bug.

When using the dynamic filter I receive the following error:

Undefined property: PowerComponents\LivewirePowerGrid\Components\Filters\FilterDynamic::$key

The FilterDynamic class is missing the key property, manually adding the property to the class (/vendor/power-components/livewire-powergrid/src/Components/Filters/FilterDynamic.php) resolve the exception.

To Reproduce...

 <?php

public function filters(): array
    {
        return [

            Filter::dynamic('customer_name', 'customer_name')
                ->component('select') //
                ->attributes([
                    'async-data'      => route('select.customer'),
                    'option-label'    => 'name',
                    'multiselect'     => false,
                    'option-value'    => 'id',
                    'wire:model.lazy' => 'filters.select.citta'
                ]),

        ];
    }

Extra information

No response