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?
5 Replies
toeknee
toeknee10mo ago
is shift an array?
Wojtek-R
Wojtek-ROP10mo ago
it is a model instance, I also get the same error if I try to pass "$shift->id"
toeknee
toeknee10mo ago
So the issue is widget-data being an array I suspect
Wojtek-R
Wojtek-ROP10mo 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?
daisy21
daisy213mo ago
have you figured it out yet? im running same issue

Did you find this page helpful?