File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 66use paragraph1 \phpFCM \Client ;
77use paragraph1 \phpFCM \Message ;
88use paragraph1 \phpFCM \Recipient \Device ;
9+ use \Illuminate \Events \Dispatcher ;
10+ use Illuminate \Notifications \Events \NotificationFailed ;
911use Illuminate \Notifications \Notification ;
1012
1113class FirebaseChannel
@@ -17,14 +19,23 @@ class FirebaseChannel
1719 */
1820 protected $ client ;
1921
22+ /**
23+ * Events dispatcher.
24+ *
25+ * @var \Illuminate\Events\Dispatcher
26+ */
27+ protected $ events ;
28+
2029 /**
2130 * Push Service constructor.
2231 *
2332 * @param \paragraph1\phpFCM\Client $client
33+ * @param \Illuminate\Events\Dispatcher $events
2434 */
25- public function __construct (Client $ client )
35+ public function __construct (Client $ client, Dispatcher $ events )
2636 {
2737 $ this ->client = $ client ;
38+ $ this ->events = $ events ;
2839 }
2940
3041 /**
@@ -54,6 +65,9 @@ public function send($notifiable, Notification $notification)
5465 $ this ->client ->send ($ message );
5566 }
5667 } catch (Exception $ e ) {
68+ $ this ->events ->fire (
69+ new NotificationFailed ($ notifiable , $ notification , $ this )
70+ );
5771 }
5872 }
5973}
You can’t perform that action at this time.
0 commit comments