# leadin/11.3.75/public/admin/modules/api/class-hublet-api-controller.php

HubSpot All-In-One Marketing – Forms, Popups, Live Chat, version 11.3.75. 41 lines.

- Page: https://pluginprobe.com/plugins/leadin/11.3.75/code/public/admin/modules/api/class-hublet-api-controller.php
- Raw: https://pluginprobe.com/plugins/leadin/11.3.75/raw/public/admin/modules/api/class-hublet-api-controller.php
- Modified: 2026-09-16T15:19:50+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/leadin/11.3.75/code/public/admin/modules/api/class-hublet-api-controller.php#L10-L20`.

```php
<?php

namespace Leadin\admin\api;

use Leadin\api\Base_Api_Controller;
use Leadin\data\Portal_Options;

/**
 * Hublet Api. Used to fetch portal's hublet and update in case of region migration
 */
class Hublet_Api_Controller extends Base_Api_Controller {

	/**
	 * Class constructor, register route.
	 */
	public function __construct() {
		self::register_leadin_admin_route(
			'/hublet',
			\WP_REST_Server::EDITABLE,
			array( $this, 'update_hublet' )
		);
	}

	/**
	 * Get's correct hublet and updates it in Options
	 *
	 * @param array $request Request body.
	 */
	public function update_hublet( $request ) {
		$data   = json_decode( $request->get_body(), true );
		$hublet = $data['hublet'];

		if ( ! $hublet ) {
			return new \WP_REST_Response( 'Hublet is required', 400 );
		}
		Portal_Options::set_hublet( $hublet );
		return new \WP_REST_Response( $hublet, 200 );
	}

}

```
