Conditions | 1 |
Paths | 1 |
Total Lines | 16 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 1 |
Changes | 4 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
37 | public function send($notifiable, Notification $notification) |
||
38 | { |
||
39 | 4 | $post = $notification->toFacebookPoster($notifiable); |
|
|
|||
40 | |||
41 | 4 | $routing = $notifiable->routeNotificationFor('facebookPoster'); |
|
42 | |||
43 | 4 | $pageId = Arr::get($routing, 'page_id', function () { |
|
44 | 2 | return $this->config->get('services.facebook_poster.page_id'); |
|
45 | }); |
||
46 | |||
47 | 4 | $accessToken = Arr::get($routing, 'access_token', function () { |
|
48 | 4 | return $this->config->get('services.facebook_poster.access_token'); |
|
49 | }); |
||
50 | |||
51 | $this->guzzle->post("https://graph.facebook.com/v18.0/{$pageId}/feed?access_token={$accessToken}", [ |
||
52 | 'form_params' => $post->getBody(), |
||
53 | ]); |
||
56 |