public function extend(Application $app) { $class = $this->class; Notification::registerType($class); User::registerPreference(User::notificationPreferenceKey($class::getType(), 'alert'), 'boolval', in_array('alert', $this->enabled)); if ($class::isEmailable()) { User::registerPreference(User::notificationPreferenceKey($class::getType(), 'email'), 'boolval', in_array('email', $this->enabled)); } NotificationSerializer::$subjects[$class::getType()] = $this->serializer; }
public function setupModels() { Model::setForum($this->app['flarum.forum']); Model::setValidator($this->app['validator']); User::setHasher($this->app['hash']); User::setFormatter($this->app['flarum.formatter']); User::registerPreference('discloseOnline', 'boolval', true); User::registerPreference('indexProfile', 'boolval', true); }