Troubleshooting htmlspecialchars() error when passing closure to ViewField->viewData in Laravel

22 views Asked by At

I am trying to retrieve a value from an input field and pass it to ViewField->viewData, but I am encountering an error. The functionality works as expected in all other areas. Would you happen to have any suggestions?

htmlspecialchars(): Argument #1 ($string) must be of type string, Closure given.

Select::make('folder_name');
ViewField::make('image')->viewData([
    'path' => fn(Get $get) => $get('folder_name'),
]);
0

There are 0 answers