user())) { $notifications = $request->user()->notifications; if (count($request->user()->unreadNotifications) > 0) { $unreadNotifications = true; } } return array_merge(parent::share($request), [ 'app_name' => config('app.name'), 'notifications' => $notifications, 'unreadNotifications' => $unreadNotifications, ]); } }