Skip to content

Commit

Permalink
remove events since they are now fired in laravel core
Browse files Browse the repository at this point in the history
  • Loading branch information
themsaid committed Aug 16, 2016
1 parent 02dcd4d commit 48a05db
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 58 deletions.
24 changes: 0 additions & 24 deletions src/Events/MessageWasSent.php

This file was deleted.

24 changes: 0 additions & 24 deletions src/Events/SendingMessage.php

This file was deleted.

10 changes: 0 additions & 10 deletions src/OneSignalChannel.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

use Berkayk\OneSignal\OneSignalClient;
use NotificationChannels\OneSignal\Exceptions\CouldNotSendNotification;
use NotificationChannels\OneSignal\Events\MessageWasSent;
use NotificationChannels\OneSignal\Events\SendingMessage;
use Illuminate\Notifications\Notification;
use Psr\Http\Message\ResponseInterface;

Expand Down Expand Up @@ -33,12 +31,6 @@ public function send($notifiable, Notification $notification)
return;
}

$shouldSendMessage = event(new SendingMessage($notifiable, $notification), [], true) !== false;

if (! $shouldSendMessage) {
return;
}

$payload = $notification->toOneSignal($notifiable)->toArray();
$payload['include_player_ids'] = collect($userIds);

Expand All @@ -48,7 +40,5 @@ public function send($notifiable, Notification $notification)
if ($response->getStatusCode() !== 200) {
throw CouldNotSendNotification::serviceRespondedWithAnError($response);
}

event(new MessageWasSent($notifiable, $notification));
}
}

0 comments on commit 48a05db

Please sign in to comment.