diff --git a/src/MandrillWebhookController.php b/src/MandrillWebhookController.php index 3e96383..9039916 100644 --- a/src/MandrillWebhookController.php +++ b/src/MandrillWebhookController.php @@ -22,7 +22,8 @@ public function handleWebHook(Request $request) foreach ($events as $event) { - $method = 'handle' . studly_case(str_replace('.', '_', $event['event'])); + $eventName = isset($event['event']) ? $event['event'] : 'undefined'; + $method = 'handle' . studly_case(str_replace('.', '_', $eventName)); if ( method_exists($this, $method) ) { $this->{$method}($event);