diff --git a/app/Http/Controllers/SettingsController.php b/app/Http/Controllers/SettingsController.php index 090883b502..76dfd21fef 100755 --- a/app/Http/Controllers/SettingsController.php +++ b/app/Http/Controllers/SettingsController.php @@ -22,6 +22,7 @@ use Input; use Redirect; use Response; use App\Helpers\StorageHelper; +use App\Http\Requests\SlackSettingsRequest; /** * This controller handles all actions related to Settings for @@ -667,25 +668,12 @@ class SettingsController extends Controller * * @return View */ - public function postSlack(Request $request) + public function postSlack(SlackSettingsRequest $request) { if (is_null($setting = Setting::getSettings())) { return redirect()->to('admin')->with('error', trans('admin/settings/message.update.error')); } - $validatedData = $request->validate([ - 'slack_channel' => 'regex:/(?slack_endpoint = $request->input('slack_endpoint'); - $setting->slack_channel = $request->input('slack_channel'); - $setting->slack_botname = $request->input('slack_botname'); - - } - if ($setting->save()) { return redirect()->route('settings.index') ->with('success', trans('admin/settings/message.update.success'));