registry->get($plugin->plugin_type); if ($handler === null) { return response()->json([ 'error' => "No handler registered for plugin type [{$plugin->plugin_type}]", ], 400); } $result = $handler->handleWebhook($request, $plugin); return $result instanceof JsonResponse ? $result : response()->json($result); } }