fixing VK api, changes in post gallery, added sections in main page

This commit is contained in:
F4ilji
2025-04-20 13:15:33 +05:00
parent e233ad5196
commit 5cfa777a6b
8 changed files with 265 additions and 174 deletions
@@ -24,6 +24,7 @@ class VkPostPublisher
$images = $this->generateImageLinksForVk($post->images);
$publishDate = $post->publish_at > now() ? $post->publish_at->timestamp : null;
dispatch(new CreateVkPost($post->title, $text, $images, $post->id, $publishDate));
}
}
+3 -1
View File
@@ -45,11 +45,13 @@ class VkAlbumService
// Загрузка изображений из URL
foreach ($images as $imageUrl) {
$fullPath = public_path($imageUrl);
$localFile = tempnam(sys_get_temp_dir(), 'img_') . '.webp';
file_put_contents($localFile, file_get_contents($imageUrl));
file_put_contents($localFile, file_get_contents($fullPath));
$localFiles[] = $localFile;
}
// Подготовка данных для отправки
$postFields = [];
foreach ($localFiles as $index => $localFile) {