Skip to content

Commit 7910525

Browse files
author
Christoph Rumpel
committed
Update readme and changelog due to the new withImage method
1 parent 3e3917a commit 7910525

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
All notable changes to the `Twitter notification channel` will be documented in this file
44

5+
## 0.0.11 - 2016-11-08
6+
7+
- refactor Twitter status updates image handling
8+
59
## 0.0.5 - 2016-09-17
610

711
- refactor the code to provide separate classes for Twitter status updates and direct messages

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,16 +102,20 @@ public function toTwitter($notifiable) {
102102
}
103103
````
104104
### Publish Twitter status update with images
105-
It is possible to publish images with your status update too. You just have to pass the image paths as the second
106-
parameter. These images will then be shown next to your Twitter status message.
105+
It is possible to publish images with your status update too. You just have to pass the image path to the `withImage`
106+
method.
107107
````php
108108
public function toTwitter($notifiable) {
109-
return new TwitterStatusUpdate(
110-
'Laravel notifications are awesome!',
111-
[public_path('marcel.png'), public_path('mohamed.png'), public_path('freek.png')]
112-
);
109+
return (new TwitterStatusUpdate('Laravel notifications are awesom!'))->withImage('marcel.png');
113110
}
114111
````
112+
If you want to use multiple images, just pass an array of paths.
113+
````php
114+
return (new TwitterStatusUpdate('Laravel notifications are awesom!'))->withImage([
115+
public_path('marcel.png'),
116+
public_path('mohamed.png')
117+
]);
118+
````
115119
### Send a direct message
116120
To send a Twitter direct message to a specific user, you will need the `TwitterDirectMessage` class. Provide the Twitter
117121
user handler as the first parameter and the the message as the second one.

0 commit comments

Comments
 (0)