$input */ public function handle(Maildispatcher $maildispatcher, array $input): void { $maildispatcher->update([ ...$input, 'filter' => (object) $input['filter'], ]); ResyncAction::dispatch(); } /** * @return array */ public function getValidationAttributes(): array { return [ 'gateway_id' => 'Verbindung', ]; } /** * @return array */ public function rules(): array { return [ 'gateway_id' => 'required|exists:mailgateways,id', 'name' => 'required|max:50', 'filter' => 'present|array', ]; } public function asController(Maildispatcher $maildispatcher, ActionRequest $request): JsonResponse { $this->handle($maildispatcher, $request->validated()); return response()->json('', 201); } }