/** * Push a notification on the dashboard * @param string $title * @param string $message * @param string $icon * @param string|null $link */ public function push($title, $message, $icon, $link = null) { $notification = $this->notification->create(['user_id' => $this->userId ?: $this->auth->check()->id, 'icon_class' => $icon, 'link' => $link, 'title' => $title, 'message' => $message]); if (true === config('asgard.notification.config.real-time', false)) { $this->triggerEventFor($notification); } }
public function markAllAsRead() { $this->notification->markAllAsReadForUser($this->auth->check()->id); flash(trans('notification::messages.all notifications marked as read')); return redirect()->route('admin.notification.notification.index'); }
public function markAsRead(Request $request) { $updated = $this->notification->markNotificationAsRead($request->get('id')); return response()->json(compact('updated')); }