diff --git a/src/Hook/SynmapHooks.php b/src/Hook/SynmapHooks.php
new file mode 100644
index 0000000..ff1b70c
--- /dev/null
+++ b/src/Hook/SynmapHooks.php
@@ -0,0 +1,20 @@
+<?php
+
+namespace Drupal\synmap\Hook;
+
+use Drupal\Core\Hook\Attribute\Hook;
+
+/**
+ * Hook implementations for synmap.
+ */
+class SynmapHooks {
+
+  /**
+   * Implements hook_page_attachments().
+   */
+  #[Hook('page_attachments')]
+  public function pageAttachments(array &$page) {
+    PageAttachments::hook($page);
+  }
+
+}
diff --git a/synmap.info.yml b/synmap.info.yml
index edbd4a9..6213684 100644
--- a/synmap.info.yml
+++ b/synmap.info.yml
@@ -1,6 +1,6 @@
 name: SynMap
 description: 'Small Map (Yandex / OSM)'
 type: module
-core_version_requirement: ^8 || ^9 || ^10 || ^11
+core_version_requirement: ^10.1 || ^11 || ^12
 configure: synmap.settings
 package: Synapse
diff --git a/synmap.module b/synmap.module
index 2c9d974..0974424 100644
--- a/synmap.module
+++ b/synmap.module
@@ -5,11 +5,13 @@
  * Module synmap.module.
  */
 
-use Drupal\synmap\Hook\PageAttachments;
+use Drupal\Core\Hook\Attribute\LegacyHook;
+use Drupal\synmap\Hook\SynmapHooks;
 
 /**
  * Implements hook_page_attachments().
  */
+#[LegacyHook]
 function synmap_page_attachments(array &$page) {
-  PageAttachments::hook($page);
+  \Drupal::service(SynmapHooks::class)->pageAttachments($page);
 }
diff --git a/synmap.services.yml b/synmap.services.yml
new file mode 100644
index 0000000..b2c4333
--- /dev/null
+++ b/synmap.services.yml
@@ -0,0 +1,5 @@
+
+services:
+  Drupal\synmap\Hook\SynmapHooks:
+    class: Drupal\synmap\Hook\SynmapHooks
+    autowire: true
