Laravel-Backpack / CRUD

Build custom admin panels. Fast!
https://backpackforlaravel.com
MIT License
3k stars 880 forks source link

Attribute to set `key` to livewire widget. #5522

Closed karandatwani92 closed 1 month ago

karandatwani92 commented 1 month ago

WHY

I have a livewire component, and I need to set a key to the livewire component, but the widget gives no way to set one.

AFTER - What is happening after this PR?

Now I can, with the added key attribute.

Widget::make([
   'type'        => 'livewire',
   'content'   => 'livewire-line-chart',
   'parameters'      => ['lineChartModel' => $lineChartModel],
   'livewireAssets' => false,
   'wrapperClass' => 'col-md-12',
+  'key'=>$lineChartModel->reactiveKey(),
]);

Is it a breaking change?

NO

How can we test the before & after?

Just remove or pass the key.