Pass data to widget from custom page

Hi, I'm trying to pass custom variable to widget component like below, but keep getting this error
<x-filament-panels::page :widget-data="['shift' => $shift]">
<x-filament-panels::page :widget-data="['shift' => $shift]">
"trim(): Argument #1 ($string) must be of type string, array given" any help guys?
4 Replies
toeknee
toeknee3mo ago
is shift an array?
Wojtek-R
Wojtek-R3mo ago
it is a model instance, I also get the same error if I try to pass "$shift->id"
toeknee
toeknee3mo ago
So the issue is widget-data being an array I suspect
Wojtek-R
Wojtek-R3mo ago
I have tried it this way as it was mentioned in this thread: https://discord.com/channels/883083792112300104/1095984082212634674 it does not throw an error when I pass it like that: <x-filament-panels::page :widget-data="$shift"> but not sure how to access it then on widget component? any ideas?