twitter: Undefined property: stdClass::$media_id_string
Hi,
when i try to run my code i get
Undefined property: stdClass::$media_id_string
on
$post->notify(new \App\Notifications\PostPublished($post));
here is my notification function:
public function toTwitter($post)
{
$title = $post->title;
$slug = $post->slug;
$image = $post->image;
return (new TwitterStatusUpdate($title ."\n https://domain.co/blog/". $slug))->withImage('http://domain.co/storage/images/'.$image);
}
any idea?
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 17
@christophrumpel I solved the issue and just to let you know, all i had to do was
Also if someone else some day ends up here can double check their
envvalues by tinker like:If return the value that is set in
envfile they are good to go.PS: Another thing maybe you like to mention in documents is that for image you must provide full address
$post->imageis not enough and returns error of can’t getting file, should be likehttp://domain.co/storage/images/$post->imageHave fun.
Thx a lot for mentioning it! I will add it to the docs. Glad it works now.
Have you checked the installation instructions here? https://github.com/laravel-notification-channels/twitter
You need to add these to the
config/services.phpfile:And you need to add those values to your
.envfile. Have you done that?