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