record; // Sync the users before saving. if (method_exists($state, 'users')) { $state->users()->sync($this->form->getState()['user_id']); } } }