1
1
# Facebook Notifications Channel for Laravel
2
2
3
- [ ![ Latest Version on Packagist] ( https://img.shields.io/packagist/v/laravel-notification-channels/facebook.svg?style=flat-square )] ( https://packagist.org/packages/laravel-notification-channels/facebook )
4
- [ ![ Software License] ( https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square )] ( LICENSE.md )
5
- [ ![ SensioLabsInsight] ( https://img.shields.io/sensiolabs/i/70841e16-34aa-496e-91c7-ba49d55841c8.svg?style=flat-square )] ( https://insight.sensiolabs.com/projects/70841e16-34aa-496e-91c7-ba49d55841c8 )
6
- [ ![ Quality Score] ( https://img.shields.io/scrutinizer/g/laravel-notification-channels/facebook.svg?style=flat-square )] ( https://scrutinizer-ci.com/g/laravel-notification-channels/facebook )
7
- [ ![ Total Downloads] ( https://img.shields.io/packagist/dt/laravel-notification-channels/facebook.svg?style=flat-square )] ( https://packagist.org/packages/laravel-notification-channels/facebook )
3
+ [ ![ Join PHP Chat] [ ico-phpchat ]] [ link-phpchat ]
4
+ [ ![ Chat on Telegram] [ ico-telegram ]] [ link-telegram ]
5
+ [ ![ Latest Version on Packagist] [ ico-version ]] [ link-packagist ]
6
+ [ ![ Software License] [ ico-license ]] ( LICENSE.md )
7
+ [ ![ Quality Score] [ ico-code-quality ]] [ link-code-quality ]
8
+ [ ![ Total Downloads] [ ico-downloads ]] [ link-packagist ]
8
9
9
10
This package makes it easy to send notifications using the [ Facebook Messenger] ( https://developers.facebook.com/docs/messenger-platform/product-overview ) with Laravel.
10
11
@@ -77,7 +78,7 @@ class InvoicePaid extends Notification
77
78
$url = url('/invoice/' . $this->invoice->id);
78
79
79
80
return FacebookMessage::create()
80
- ->to($this->user ->fb_messenger_user_id) // Optional
81
+ ->to($notifiable ->fb_messenger_user_id) // Optional
81
82
->text('One of your invoices has been paid!')
82
83
->isUpdate() // Optional
83
84
->isTypeRegular() // Optional
@@ -103,7 +104,7 @@ The notification will be sent from your Facebook page, whose page token you have
103
104
Send a basic text message to a user
104
105
``` php
105
106
return FacebookMessage::create('You have just paid your monthly fee! Thanks')
106
- ->to($this->user->fb_messenger_id );
107
+ ->to($notifiable->fb_messenger_user_id );
107
108
```
108
109
##### Attachment Message
109
110
@@ -112,7 +113,7 @@ Send a file attachment to a user (Example is sending a pdf invoice)
112
113
``` php
113
114
return FacebookMessage::create()
114
115
->attach(AttachmentType::FILE, url('invoices/'.$this->invoice->id))
115
- ->to($this->user->fb_messenger_id );
116
+ ->to($notifiable->fb_messenger_user_id );
116
117
```
117
118
118
119
##### Generic (Card Carousel) Message
@@ -121,7 +122,7 @@ Send a set of cards / items to a user displayed in a carousel (Example is sendin
121
122
122
123
``` php
123
124
return FacebookMessage::create()
124
- ->to($this->user->fb_messenger_id ) // Optional
125
+ ->to($notifiable->fb_messenger_user_id ) // Optional
125
126
->cards([
126
127
Card::create('Card No.1 Title')
127
128
->subtitle('An item description')
@@ -193,9 +194,26 @@ Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
193
194
194
195
## Credits
195
196
196
- - [ Syed Irfaq R. ] ( https://github.com/irazasyed )
197
- - [ All Contributors] ( ../../ contributors)
197
+ - [ Irfaq Syed ] [ link-author ]
198
+ - [ All Contributors] [ link- contributors]
198
199
199
200
## License
200
201
201
202
The MIT License (MIT). Please see [ License File] ( LICENSE.md ) for more information.
203
+
204
+ [ ico-phpchat ] : https://img.shields.io/badge/Slack-PHP%20Chat-5c6aaa.svg?style=flat-square&logo=slack&labelColor=4A154B
205
+ [ ico-telegram ] : https://img.shields.io/badge/@PHPChatCo-2CA5E0.svg?style=flat-square&logo=telegram&label=Telegram
206
+ [ ico-version ] : https://img.shields.io/packagist/v/laravel-notification-channels/facebook.svg?style=flat-square
207
+ [ ico-license ] : https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square
208
+ [ ico-scrutinizer ] : https://img.shields.io/scrutinizer/coverage/g/laravel-notification-channels/facebook.svg?style=flat-square
209
+ [ ico-code-quality ] : https://img.shields.io/scrutinizer/g/laravel-notification-channels/facebook.svg?style=flat-square
210
+ [ ico-downloads ] : https://img.shields.io/packagist/dt/laravel-notification-channels/facebook.svg?style=flat-square
211
+
212
+ [ link-phpchat ] : https://phpchat.co/?ref=laravel-channel-facebook
213
+ [ link-telegram ] : https://t.me/PHPChatCo
214
+ [ link-repo ] : https://github.com/laravel-notification-channels/facebook
215
+ [ link-packagist ] : https://packagist.org/packages/laravel-notification-channels/facebook
216
+ [ link-scrutinizer ] : https://scrutinizer-ci.com/g/laravel-notification-channels/facebook/code-structure
217
+ [ link-code-quality ] : https://scrutinizer-ci.com/g/laravel-notification-channels/facebook
218
+ [ link-author ] : https://github.com/irazasyed
219
+ [ link-contributors ] : ../../contributors
0 commit comments