コード例 #1
0
 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     $this->app['config']->package('edvinaskrucas/notification', __DIR__ . '/../config');
     $this->app['notification'] = $this->app->share(function ($app) {
         $config = $app['config'];
         $notification = new Notification($config->get('notification::default_container'), $config->get('notification::default_types'), $config->get('notification::default_format'), $config->get('notification::default_formats'));
         $notification->setEventDispatcher($app['events']);
         return $notification;
     });
     $this->app->bind('Krucas\\Notification\\Subscriber', function ($app) {
         return new Subscriber($app['session'], $app['config']);
     });
     $this->app['events']->subscribe('Krucas\\Notification\\Subscriber');
 }
コード例 #2
0
 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     $this->mergeConfigFrom(__DIR__ . '/../../config/notification.php', 'notification');
     $this->app->singleton('notification', function ($app) {
         $config = $app['config'];
         $notification = new Notification($config->get('notification.default_container'), $config->get('notification.default_types'), $config->get('notification.types'), $config->get('notification.default_format'), $config->get('notification.format'), $config->get('notification.default_formats'), $config->get('notification.formats'));
         $notification->setEventDispatcher($app['events']);
         return $notification;
     });
     $this->app->alias('notification', 'Krucas\\Notification\\Notification');
     $this->app->singleton('Krucas\\Notification\\Subscriber', function ($app) {
         return new Subscriber($app['session.store'], $app['config']['notification.session_key']);
     });
     $this->app->singleton('Krucas\\Notification\\Middleware\\NotificationMiddleware', function ($app) {
         return new NotificationMiddleware($app['session.store'], $app['notification'], $app['config']->get('notification.session_key'));
     });
 }
コード例 #3
0
ファイル: _ide_helper.php プロジェクト: phillipmadsen/deved
 /**
  * Set the event dispatcher instance.
  *
  * @param \Illuminate\Contracts\Events\Dispatcher $dispatcher
  * @return void 
  * @static 
  */
 public static function setEventDispatcher($dispatcher)
 {
     \Krucas\Notification\Notification::setEventDispatcher($dispatcher);
 }