Repeater and EditAction error

I have a list of items created from the Repeater Input and saved in DB as a json. When I used the edit action I get and error.
foreach() argument must be of type array|object, string given {"userId":1,"exception":"[object] (ErrorException(code: 0): foreach() argument must be of type array|object, string given at /var/www/html/vendor/filament/forms/src/Components/Repeater.php:783)

Below is how I try to 

->beforeFormFilled(function (EditAction $action, Order $record) {
                            // Runs before the form fields are populated from the database.
                            // dd(gettype(json_decode($record['items'],true)));
                            $record['items'] = json_decode($record['items'], true);
                        })
 dd(gettype(json_decode($record['items'])));
                            $record['items'] = json_decode($record['items'], true); 
Solution
Right, but a repeater, unless it is a relationship, needs to be cast on the model as either array or json.
Was this page helpful?