| @@ 186-202 (lines=17) @@ | ||
| 183 | return redirect()->back()->with('success', Lang::get('lang.form_deleted_successfully')); |
|
| 184 | } |
|
| 185 | ||
| 186 | public function edit($id) |
|
| 187 | { |
|
| 188 | try { |
|
| 189 | $forms = new Forms(); |
|
| 190 | $form = $forms->find($id); |
|
| 191 | $select_forms = $forms->where('id', '!=', $id)->lists('formname', 'id')->toArray(); |
|
| 192 | //dd($form); |
|
| 193 | if ($form) { |
|
| 194 | $fields = $form->fields(); |
|
| 195 | //dd($fields); |
|
| 196 | return view('themes.default1.admin.helpdesk.manage.form.edit', compact('form', 'fields', 'select_forms')); |
|
| 197 | } |
|
| 198 | throw new Exception("Sorry we can't find your request"); |
|
| 199 | } catch (Exception $ex) { |
|
| 200 | return redirect()->back()->with('fails', $ex->getMessage()); |
|
| 201 | } |
|
| 202 | } |
|
| 203 | ||
| 204 | public function addChildForm($id) |
|
| 205 | { |
|
| @@ 204-220 (lines=17) @@ | ||
| 201 | } |
|
| 202 | } |
|
| 203 | ||
| 204 | public function addChildForm($id) |
|
| 205 | { |
|
| 206 | try { |
|
| 207 | $forms = new Forms(); |
|
| 208 | $form = $forms->find($id); |
|
| 209 | $select_forms = $forms->where('id', '!=', $id)->lists('formname', 'id')->toArray(); |
|
| 210 | //dd($form); |
|
| 211 | if ($form) { |
|
| 212 | $fields = $form->fields(); |
|
| 213 | //dd($fields); |
|
| 214 | return view('themes.default1.admin.helpdesk.manage.form.add-child', compact('form', 'fields', 'select_forms')); |
|
| 215 | } |
|
| 216 | throw new Exception("Sorry we can't find your request"); |
|
| 217 | } catch (Exception $ex) { |
|
| 218 | return redirect()->back()->with('fails', $ex->getMessage()); |
|
| 219 | } |
|
| 220 | } |
|
| 221 | ||
| 222 | public function update($id, Request $request) |
|
| 223 | { |
|