MedicOneSystems / livewire-datatables

Advanced datatables using Laravel, Livewire, Tailwind CSS and Alpine JS
https://livewire-datatables.com/
MIT License
1.19k stars 258 forks source link

Column::callback(): Argument #2 ($callback) must be of type Closure, string given #430

Closed code23-barna closed 2 years ago

code23-barna commented 2 years ago

Error message:

Mediconesystems\LivewireDatatables\Column::callback(): Argument #2 ($callback) must be of type Closure, string given

Issue:

In src/Column.php:119 you set the type to "Closure" when it should be Closure|string

Steps to reproduce:

Add something like this in your columns() method:

 Column::callback(['id', 'title'], 'someLocalMethod');
thyseus commented 2 years ago

Thanks a lot for reporting this error.

I would prefer this solution: https://github.com/MedicOneSystems/livewire-datatables/pull/433/files Could you please check if this PR solves your issue ?

code23-barna commented 2 years ago

Hi @thyseus , if i change it to 'callable' it is giving me the error:

Mediconesystems\LivewireDatatables\Column::callback(): Argument #2 ($callback) must be of type callable, string given, called in
thyseus commented 2 years ago

Ok, i see. So will merge your solution instead of mine.