Inheritance: implements Illuminate\Support\Contracts\ArrayableInterface, implements Illuminate\Support\Contracts\JsonableInterface, implements Countabl\Countable
Esempio n. 1
0
 /**
  * Execute this event to flash messages.
  *
  * @param Notification $notification
  * @param NotificationsBag $notificationBag
  * @param Message $message
  * @return bool
  */
 public function onFlash(Notification $notification, NotificationsBag $notificationBag, Message $message)
 {
     $this->flashContainerNames($notification);
     $sessionKey = $this->getConfig()->get('notification.session_prefix');
     $sessionKey .= $notificationBag->getName();
     $sessionKey .= '_' . $this->generateMessageKey($message);
     $this->getSession()->flash($sessionKey, $message->toJson());
     return true;
 }
Esempio n. 2
0
 /**
  * Fire given event.
  *
  * @param $event
  * @param \Krucas\Notification\NotificationsBag $notificationBag
  * @param \Krucas\Notification\Message $message
  * @return array|bool|null
  */
 public function fire($event, NotificationsBag $notificationBag, Message $message)
 {
     if (!isset(static::$dispatcher)) {
         return true;
     }
     $event = "notification.{$event}: " . $notificationBag->getName();
     return static::$dispatcher->fire($event, array($this, $notificationBag, $message));
 }
Esempio n. 3
0
 /**
  * Execute this event to flash messages.
  *
  * @param Notification $notification
  * @param NotificationsBag $notificationBag
  * @param Message $message
  * @return bool
  */
 public function onFlash(Notification $notification, NotificationsBag $notificationBag, Message $message)
 {
     $key = implode('.', [$this->key, $notificationBag->getName()]);
     $this->session->push($key, $message);
     return true;
 }
 /**
  * @depends testShowAllContainers
  */
 public function testShowAllContainersWithACustomFormat(\Krucas\Notification\NotificationsBag $bag)
 {
     $this->assertContains('w m', $bag->showAll(':message'));
     return $bag;
 }
 public function extractType($name)
 {
     return parent::extractType($name);
 }