Exemplo n.º 1
0
 /**
  * Boot the model
  */
 protected static function boot()
 {
     $instance = new static();
     $class = get_class($instance);
     $events = $instance->getObservableEvents();
     $observer = substr($class, 0, -5) . 'Observer';
     if ($events && class_exists($observer)) {
         self::observe(app($observer));
     }
     if ($events && !static::$dispatcher->hasListeners('eloquent.' . array_shift($events) . ': ' . $class)) {
         self::observe(EntryObserver::class);
     }
     parent::boot();
 }
Exemplo n.º 2
0
 /**
  * Boot the model
  */
 protected static function boot()
 {
     $instance = new static();
     $class = get_class($instance);
     $events = $instance->getObservableEvents();
     $observer = substr($class, 0, -5) . 'Observer';
     $observing = class_exists($observer);
     if ($events && $observing) {
         self::observe(app($observer));
     }
     if (!$instance->isSearchable()) {
         ModelObserver::disableSyncingFor(get_class(new static()));
     }
     if ($events && !$observing) {
         self::observe(EntryObserver::class);
     }
     parent::boot();
 }
Exemplo n.º 3
0
 /**
  * Boot the model.
  */
 protected static function boot()
 {
     self::$store = app('Anomaly\\Streams\\Platform\\Stream\\StreamStore');
     parent::boot();
 }
Exemplo n.º 4
0
 /**
  * Boot the model.
  */
 protected static function boot()
 {
     self::$builder = app(FieldTypeBuilder::class);
     parent::boot();
 }
 /**
  * Boot the model.
  */
 protected static function boot()
 {
     self::observe(app(substr(__CLASS__, 0, -5) . 'Observer'));
     parent::boot();
 }