Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Cannot access images in timeline posts #58

Open
lieb77 opened this issue Feb 23, 2025 · 1 comment
Open

[Bug]: Cannot access images in timeline posts #58

lieb77 opened this issue Feb 23, 2025 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@lieb77
Copy link

lieb77 commented Feb 23, 2025

Describe the bug

Cannot access images in timeline posts.

Steps to reproduce

 $feed =  $this->client->app()->bsky()->feed()->getTimeline()->forge()
    ->limit(10)
    ->send()
    ->feed();
    
    $myFeed = [];
    foreach($feed as $entry) {
        if ($entry->post()->has('embed')) {
            **$embed = $entry->post()->embed();**

Expected behavior

I'd like to be able to display images that are part of the post.

PHP Version

PHP 8.2

Package Version

1.7.0-beta

Relevant log output

Atproto\Exceptions\BadMethodCallException: 
Unsupported embed type: app.bsky.embed.images#view 
in Atproto\Factories\EmbedFactory::make() 
line 32 of .. /vendor/shahmal1yev/blueskysdk/src/Factories/EmbedFactory.php

Additional context

Maybe this is fixed in 1.8.0-beta, however I cannot install that due to a dependency conflict.

shahmal1yev/blueskysdk v1.8.0-beta requires illuminate/collections ~v8.83
but the package is fixed to v11.43.2

$ composer why illuminate/collections 
laravel/prompts v0.1.25 requires illuminate/collections (^10.0|^11.0)

If you could update your dependency to illuminate/collections:^11.43.2 that would be good

@lieb77 lieb77 added the bug Something isn't working label Feb 23, 2025
@lieb77
Copy link
Author

lieb77 commented Feb 24, 2025

There is a work around for this issue using jsonSerialize to grab the whole thing

if ($post->has('embed')){
   $content = $post->jsonSerialize();
   $external = $content['embed']['external'];
}

@shahmal1yev shahmal1yev self-assigned this Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants