'Application settings | Chart-Board', 'allow_registration' => $settings->getBoolean(null, 'allow_registration', true), 'max_workspaces' => $settings->getInt(null, 'max_workspaces', 10), ]); } public function update() { $rules = [ 'allow_registration' => 'required|in_list[0,1]', 'max_workspaces' => 'required|integer|greater_than_equal_to[1]|less_than_equal_to[9999]', ]; if (! $this->validate($rules)) { return redirect()->back()->withInput()->with('errors', $this->validator->getErrors()); } $settings = new SettingsModel(); $settings->setValue( null, 'allow_registration', (string) $this->request->getPost('allow_registration'), 'boolean' ); $settings->setValue( null, 'max_workspaces', (string) $this->request->getPost('max_workspaces'), 'integer' ); AuditLogger::log( 'app.settings_updated', 'settings', null, null, [ 'allow_registration' => (int) $this->request->getPost('allow_registration'), 'max_workspaces' => (int) $this->request->getPost('max_workspaces'), ], null, (int) $this->session->get('user_id') ); return redirect()->to('/admin/settings')->with('success', 'Application settings updated.'); } }