This commit is contained in:
F4ilji
2026-03-20 23:35:09 +05:00
parent c80a52ab86
commit 836452add6
9 changed files with 88 additions and 17 deletions
+2 -2
View File
@@ -53,7 +53,7 @@ class VkService
// return $this->wallService->createPost($message, $from_group, $attachmentString, $publish_date);
// }
public function createPost(string $title, string $message, array $images = [], array $videos = [], int|null $publish_date = null)
public function createPost(string $title, string $message, array $images = [], array $videos = [], int|null $publish_date = null, string $primary_attachments_mode = 'carousel')
{
$from_group = 1;
$attachments = [];
@@ -76,7 +76,7 @@ class VkService
$attachmentString = implode(',', $attachments);
return $this->wallService->createPost($message, $from_group, $attachmentString, $publish_date);
return $this->wallService->createPost($message, $from_group, $attachmentString, $publish_date, $primary_attachments_mode);
}
public function updatePost(int $id, string $title, string $message, array $images = [], int|null $publish_date = null)
+2 -1
View File
@@ -48,7 +48,7 @@ class VkWallService
}
}
public function createPost(string $message, int $from_group, string $attachments = '', int|null $publish_date = null)
public function createPost(string $message, int $from_group, string $attachments = '', int|null $publish_date = null, string $primary_attachments_mode = 'carousel')
{
$token = $this->vkAuthService->getToken()->access_token;
$params = [
@@ -58,6 +58,7 @@ class VkWallService
'attachments' => $attachments,
'access_token' => $token,
'publish_date' => $publish_date,
'primary_attachments_mode' => $primary_attachments_mode,
'v' => '5.131',
];