/** * Create a new event instance. * * @return void */ public function __construct($holder, $type, $item) { $this->holder = $holder; $notificationRepository = new NotificationRepository(); if ($type == 'App\\Article') { $this->notification = $notificationRepository->article($item); } elseif ($type == 'App\\Post') { $this->notification = $notificationRepository->post($item); } }