fixing VK api, changes in post gallery, added sections in main page
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user