$input */ public function handle(array $input): void { $settings = app(ModuleSettings::class); $settings->fill([ 'modules' => $input['modules'], ]); $settings->save(); } /** * @return array */ public function rules(): array { return [ 'modules' => 'present|array', 'modules.*' => ['string', Rule::in(Module::values())], ]; } public function asController(ActionRequest $request): RedirectResponse { $this->handle($request->validated()); return redirect()->back(); } }