| @@ 107-121 (lines=15) @@ | ||
| 104 | return redirect()->route('admin.services.service', $service)->withInput(); |
|
| 105 | } |
|
| 106 | ||
| 107 | public function deleteService(Request $request, $service) |
|
| 108 | { |
|
| 109 | try { |
|
| 110 | $repo = new ServiceRepository\Service; |
|
| 111 | $repo->delete($service); |
|
| 112 | Alert::success('Successfully deleted that service.')->flash(); |
|
| 113 | ||
| 114 | return redirect()->route('admin.services'); |
|
| 115 | } catch (DisplayException $ex) { |
|
| 116 | Alert::danger($ex->getMessage())->flash(); |
|
| 117 | } catch (\Exception $ex) { |
|
| 118 | Log::error($ex); |
|
| 119 | Alert::danger('An error was encountered while attempting to delete that service.')->flash(); |
|
| 120 | } |
|
| 121 | ||
| 122 | return redirect()->route('admin.services.service', $service); |
|
| 123 | } |
|
| 124 | ||
| @@ 152-169 (lines=18) @@ | ||
| 149 | return redirect()->route('admin.services.option', [$service, $option])->withInput(); |
|
| 150 | } |
|
| 151 | ||
| 152 | public function deleteOption(Request $request, $service, $option) |
|
| 153 | { |
|
| 154 | try { |
|
| 155 | $repo = new ServiceRepository\Option; |
|
| 156 | $repo->delete($option); |
|
| 157 | ||
| 158 | Alert::success('Successfully deleted that option.')->flash(); |
|
| 159 | ||
| 160 | return redirect()->route('admin.services.service', $service); |
|
| 161 | } catch (DisplayException $ex) { |
|
| 162 | Alert::danger($ex->getMessage())->flash(); |
|
| 163 | } catch (\Exception $ex) { |
|
| 164 | Log::error($ex); |
|
| 165 | Alert::danger('An error was encountered while attempting to delete this option.')->flash(); |
|
| 166 | } |
|
| 167 | ||
| 168 | return redirect()->route('admin.services.option', [$service, $option]); |
|
| 169 | } |
|
| 170 | ||
| 171 | public function postOptionVariable(Request $request, $service, $option, $variable) |
|
| 172 | { |
|
| @@ 67-81 (lines=15) @@ | ||
| 64 | ]); |
|
| 65 | } |
|
| 66 | ||
| 67 | public function deleteUser(Request $request, $id) |
|
| 68 | { |
|
| 69 | try { |
|
| 70 | $repo = new UserRepository; |
|
| 71 | $repo->delete($id); |
|
| 72 | Alert::success('Successfully deleted user from system.')->flash(); |
|
| 73 | ||
| 74 | return redirect()->route('admin.users'); |
|
| 75 | } catch (DisplayException $ex) { |
|
| 76 | Alert::danger($ex->getMessage())->flash(); |
|
| 77 | } catch (\Exception $ex) { |
|
| 78 | Log::error($ex); |
|
| 79 | Alert::danger('An exception was encountered while attempting to delete this user.')->flash(); |
|
| 80 | } |
|
| 81 | ||
| 82 | return redirect()->route('admin.users.view', $id); |
|
| 83 | } |
|
| 84 | ||