From 8608faa1a2ac2034f887ab485730f1233aea802a Mon Sep 17 00:00:00 2001 From: Jay Smith Date: Fri, 12 Apr 2019 17:51:35 -0700 Subject: [PATCH 1/2] add sharable property on generic template --- src/Extensions/GenericTemplate.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Extensions/GenericTemplate.php b/src/Extensions/GenericTemplate.php index 5b8f373..1cd123c 100644 --- a/src/Extensions/GenericTemplate.php +++ b/src/Extensions/GenericTemplate.php @@ -69,6 +69,16 @@ public function addImageAspectRatio($ratio) return $this; } + /** + * @param string $ratio + * @return $this + */ + public function addSharable($sharable) + { + $this->sharable = $sharable; + return $this; + } + /** * @return array */ @@ -79,6 +89,7 @@ public function toArray() 'type' => 'template', 'payload' => [ 'template_type' => 'generic', + 'sharable' => $this->sharable, 'image_aspect_ratio' => $this->imageAspectRatio, 'elements' => $this->elements, ], From f089a3f04fb88369e49f936c7432f94a4a3841aa Mon Sep 17 00:00:00 2001 From: Jay Smith Date: Sun, 2 Feb 2020 14:20:31 -0800 Subject: [PATCH 2/2] fix bug in fb driver --- src/FacebookDriver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100755 => 100644 src/FacebookDriver.php diff --git a/src/FacebookDriver.php b/src/FacebookDriver.php old mode 100755 new mode 100644 index 80d341e..f39b67a --- a/src/FacebookDriver.php +++ b/src/FacebookDriver.php @@ -89,7 +89,7 @@ class FacebookDriver extends HttpDriver implements VerifiesService public function buildPayload(Request $request) { $this->payload = new ParameterBag((array) json_decode($request->getContent(), true)); - $this->event = Collection::make((array) $this->payload->get('entry')[0]); + $this->event = Collection::make((array) $this->payload->get('entry', ['null'])[0]); $this->signature = $request->headers->get('X_HUB_SIGNATURE', ''); $this->content = $request->getContent(); $this->config = Collection::make($this->config->get('facebook', []));