Update field via frontend (multilanguage site)

Hi there,

Im building a multilanguage website: dutch (default) and english.
The registrations field has type “users” and has “translate” set to false.

I want both dutch and english version to show the same list of users — I don’t want to seperate the dutch and english users from each other.

When Im visiting the english version, I can’t seem to update the registrations field.
I can only seem to make it work on the dutch version.

Is there a way to update the registrations field from the front end when im visiting the website in english (not default language)?

try {
$newPage = $page->update([
‘registrations’ => $registrations->toArray(),
]);
} catch(Exception $e) {
echo $e->getMessage();
}

Screenshot 2022-01-12 at 16.51.27

You have to pass the language you want to update as second parameter:

$newPage = $page->update([
‘registrations’ => $registrations->toArray(),
], 'nl');
1 Like