| @@ 97-111 (lines=15) @@ | ||
| 94 | ]); |
|
| 95 | } |
|
| 96 | ||
| 97 | public function deleteUser(Request $request, $id) |
|
| 98 | { |
|
| 99 | try { |
|
| 100 | $repo = new UserRepository; |
|
| 101 | $repo->delete($id); |
|
| 102 | Alert::success('Successfully deleted user from system.')->flash(); |
|
| 103 | ||
| 104 | return redirect()->route('admin.users'); |
|
| 105 | } catch (DisplayException $ex) { |
|
| 106 | Alert::danger($ex->getMessage())->flash(); |
|
| 107 | } catch (\Exception $ex) { |
|
| 108 | Log::error($ex); |
|
| 109 | Alert::danger('An exception was encountered while attempting to delete this user.')->flash(); |
|
| 110 | } |
|
| 111 | ||
| 112 | return redirect()->route('admin.users.view', $id); |
|
| 113 | } |
|
| 114 | ||
| @@ 114-128 (lines=15) @@ | ||
| 111 | return redirect()->route('admin.services.service', $service)->withInput(); |
|
| 112 | } |
|
| 113 | ||
| 114 | public function deleteService(Request $request, $service) |
|
| 115 | { |
|
| 116 | try { |
|
| 117 | $repo = new ServiceRepository\Service; |
|
| 118 | $repo->delete($service); |
|
| 119 | Alert::success('Successfully deleted that service.')->flash(); |
|
| 120 | ||
| 121 | return redirect()->route('admin.services'); |
|
| 122 | } catch (DisplayException $ex) { |
|
| 123 | Alert::danger($ex->getMessage())->flash(); |
|
| 124 | } catch (\Exception $ex) { |
|
| 125 | Log::error($ex); |
|
| 126 | Alert::danger('An error was encountered while attempting to delete that service.')->flash(); |
|
| 127 | } |
|
| 128 | ||
| 129 | return redirect()->route('admin.services.service', $service); |
|
| 130 | } |
|
| 131 | ||
| @@ 165-182 (lines=18) @@ | ||
| 162 | return redirect()->route('admin.services.option', [$service, $option])->withInput(); |
|
| 163 | } |
|
| 164 | ||
| 165 | public function deleteOption(Request $request, $service, $option) |
|
| 166 | { |
|
| 167 | try { |
|
| 168 | $repo = new ServiceRepository\Option; |
|
| 169 | $repo->delete($option); |
|
| 170 | ||
| 171 | Alert::success('Successfully deleted that option.')->flash(); |
|
| 172 | ||
| 173 | return redirect()->route('admin.services.service', $service); |
|
| 174 | } catch (DisplayException $ex) { |
|
| 175 | Alert::danger($ex->getMessage())->flash(); |
|
| 176 | } catch (\Exception $ex) { |
|
| 177 | Log::error($ex); |
|
| 178 | Alert::danger('An error was encountered while attempting to delete this option.')->flash(); |
|
| 179 | } |
|
| 180 | ||
| 181 | return redirect()->route('admin.services.option', [$service, $option]); |
|
| 182 | } |
|
| 183 | ||
| 184 | public function postOptionVariable(Request $request, $service, $option, $variable) |
|
| 185 | { |
|