runningInConsole() || !config('app.installed') || !user()) { return; } $path = Route::current()->uri(); if (empty($path)) { return; } $notifications = $this->getNotifications($path); if (empty($notifications)) { return; } // Push to a stack foreach ($notifications as $notification) { $setting = 'notifications.'. $notification->path . '.' . $notification->id . '.status'; $path = str_replace('/', '#', $notification->path); $message = str_replace('#path#', $path, $notification->message); $message = str_replace('#token#', csrf_token(), $message); if (setting($setting, 1)) { $view->getFactory()->startPush('content_content_start', $message); } } } }