app->environment('production')) { URL::forceScheme('https'); } View::composer('*', function ($view) { $notifikasi = collect([]); $unreadNotificationsCount = 0; // Hanya ambil notifikasi jika ada pengguna yang login if (auth()->check()) { $user = auth()->user(); $notifikasi = collect(DummyDataService::getNotifikasiForUser($user)); $unreadNotificationsCount = $notifikasi->where('read', false)->count(); } $view->with(compact('notifikasi', 'unreadNotificationsCount')); }); } }