*/ public array $initializers = [ InitializeGroups::class, InitializeNationalities::class, InitializeFees::class, InitializeActivities::class, InitializeConfessions::class, InitializeCountries::class, InitializeGenders::class, InitializeRegions::class, InitializeCourses::class, InitializeMembers::class, ]; public function handle(): void { $api = app(NamiSettings::class)->login(); foreach ($this->initializers as $initializer) { app($initializer)->handle($api); } } /** * @return array */ public function rules(): array { return [ 'mglnr' => 'required|numeric', 'password' => 'required|string', 'group_id' => 'required|numeric', 'params' => 'required|array', ]; } /** * @return array */ public function getValidationAttributes(): array { return [ 'group_id' => 'Gruppierungsnr', ]; } public function asController(ActionRequest $request, NamiSettings $settings): RedirectResponse { $settings->mglnr = (int) $request->input('mglnr'); $settings->password = $request->input('password'); $settings->default_group_id = (int) $request->input('group_id'); $settings->search_params = $request->input('params'); $settings->save(); self::dispatch(); return redirect()->route('home'); } }