File tree Expand file tree Collapse file tree
app/Http/Controllers/Admin Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,6 +49,9 @@ public function recipients(Request $request): JsonResponse
4949 $ query ->where ('is_verified ' , false );
5050 } elseif ($ type === 'staff ' ) {
5151 $ query ->where ('is_verified ' , true );
52+ } elseif ($ type === 'push_subscribers ' ) {
53+ $ pushUserIds = PushSubscription ::distinct ('subscribable_id ' )->pluck ('subscribable_id ' );
54+ $ query ->whereIn ('id ' , $ pushUserIds );
5255 }
5356
5457 $ emails = $ query ->pluck ('email ' );
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import {
1616 Download ,
1717 ChevronDown ,
1818 Bell ,
19+ BellRing ,
1920 Megaphone ,
2021} from ' lucide-vue-next' ;
2122
@@ -582,6 +583,28 @@ const submitForm = () => {
582583 {{ staffCount }}
583584 </span >
584585 </button >
586+
587+ <!-- Option 5: Web Push Subscribers -->
588+ <button
589+ type =" button"
590+ :disabled =" pushUsersCount === 0"
591+ @click ="
592+ importSubscribers('push_subscribers')
593+ "
594+ class =" flex w-full items-center justify-between rounded-xl px-3 py-2 text-left text-xs font-semibold text-slate-700 transition hover:bg-indigo-50 hover:text-indigo-600 disabled:cursor-not-allowed disabled:opacity-50 dark:text-gray-200 dark:hover:bg-indigo-950/40 dark:hover:text-indigo-400"
595+ >
596+ <div class =" flex items-center gap-2" >
597+ <BellRing
598+ class="h-4 w-4 text-emerald-500"
599+ />
600+ <span >Push Subscribers</span >
601+ </div >
602+ <span
603+ class =" rounded-md bg-emerald-50 px-1.5 py-0.5 text-[10px] font-bold text-emerald-600 dark:bg-emerald-950/50 dark:text-emerald-400"
604+ >
605+ {{ pushUsersCount }}
606+ </span >
607+ </button >
585608 </div >
586609 </div >
587610
You can’t perform that action at this time.
0 commit comments