rappasoft / laravel-livewire-tables

A dynamic table component for Laravel Livewire
https://rappasoft.com/docs/laravel-livewire-tables/v2/introduction
MIT License
1.75k stars 328 forks source link

Unable to pass parameters to configurable areas #762

Closed michele-grifa closed 2 years ago

michele-grifa commented 2 years ago

I'm using the code from the documentation to pass a parameter to a configurable area, but when i load the page i get the following error

Rappasoft\LaravelLivewireTables\DataTableComponent::getConfigurableAreaFor(): Return value must be of type ?string, array returned (View: /var/www/resources/views/vendor/livewire-tables/components/tools/toolbar.blade.php)

The code i'm using:

$this->setConfigurableAreas([
  'toolbar-left-end' => [
      'anagrafiche.anagrafiche-toolbar-left', [
          'testata' => 'test',
      ],
  ],
])
rappasoft commented 2 years ago

Edit: Let me look.

Hmm your code worked for me locally, you have the most up to date version of everything?

michele-grifa commented 2 years ago

I was using 2.4.0, and now i updated to 2.6.0. That problem is gone, but i get Undefined variable $testata in the blade file

rappasoft commented 2 years ago

Hmm I have no issues, do you have the views published?

michele-grifa commented 2 years ago

Yes i have

rappasoft commented 2 years ago

You shouldn't, delete them and it will work. Publishing the views should only be used if you really need to edit a file, and even in that case, only publish the files you need because Laravel uses them over mine so If I update them you don't get the changes.

michele-grifa commented 2 years ago

Ok, now it works.

How i can publish only one file if i need?

rappasoft commented 2 years ago

Just delete the published files you don't need.

michele-grifa commented 2 years ago

Thanks