Inheritance: extends Exceptio\Exception
Example #1
0
 protected function determineNotification($event) : Notification
 {
     $eventName = class_basename($event);
     $notificationClass = collect($this->config->get('laravel-backup.notifications.notifications'))->keys()->first(function ($notificationClass) use($eventName) {
         $notificationName = class_basename($notificationClass);
         return $notificationName === $eventName;
     });
     if (!$notificationClass) {
         throw NotificationCouldNotBeSent::noNotifcationClassForEvent($event);
     }
     return app($notificationClass)->setEvent($event);
 }