11# Facebook Notifications Channel for Laravel
22
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 ]
89
910This package makes it easy to send notifications using the [ Facebook Messenger] ( https://developers.facebook.com/docs/messenger-platform/product-overview ) with Laravel.
1011
@@ -77,7 +78,7 @@ class InvoicePaid extends Notification
7778 $url = url('/invoice/' . $this->invoice->id);
7879
7980 return FacebookMessage::create()
80- ->to($this->user ->fb_messenger_user_id) // Optional
81+ ->to($notifiable ->fb_messenger_user_id) // Optional
8182 ->text('One of your invoices has been paid!')
8283 ->isUpdate() // Optional
8384 ->isTypeRegular() // Optional
@@ -103,7 +104,7 @@ The notification will be sent from your Facebook page, whose page token you have
103104Send a basic text message to a user
104105``` php
105106return FacebookMessage::create('You have just paid your monthly fee! Thanks')
106- ->to($this->user->fb_messenger_id );
107+ ->to($notifiable->fb_messenger_user_id );
107108```
108109##### Attachment Message
109110
@@ -112,7 +113,7 @@ Send a file attachment to a user (Example is sending a pdf invoice)
112113``` php
113114return FacebookMessage::create()
114115 ->attach(AttachmentType::FILE, url('invoices/'.$this->invoice->id))
115- ->to($this->user->fb_messenger_id );
116+ ->to($notifiable->fb_messenger_user_id );
116117```
117118
118119##### Generic (Card Carousel) Message
@@ -121,7 +122,7 @@ Send a set of cards / items to a user displayed in a carousel (Example is sendin
121122
122123``` php
123124return FacebookMessage::create()
124- ->to($this->user->fb_messenger_id ) // Optional
125+ ->to($notifiable->fb_messenger_user_id ) // Optional
125126 ->cards([
126127 Card::create('Card No.1 Title')
127128 ->subtitle('An item description')
@@ -193,9 +194,26 @@ Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
193194
194195## Credits
195196
196- - [ Syed Irfaq R. ] ( https://github.com/irazasyed )
197- - [ All Contributors] ( ../../ contributors)
197+ - [ Irfaq Syed ] [ link-author ]
198+ - [ All Contributors] [ link- contributors]
198199
199200## License
200201
201202The 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