public function execute($request) { $setting = QubitSetting::getById($this->request->id); $this->forward404Unless($setting); // check that the setting is deleteable if ($setting->isDeleteable()) { $setting->delete(); } // TODO: else populate an error? $this->refreshSettings(); $this->redirect('settings/list'); }