@extends('layouts.dashboard') @section('content') @php /** * Push notifications — shared by the admin (platform) and vendor (own-staff) * dashboards. $scope decides the audience options and the endpoints. * Reuses the .qm-card / .qm-table / .modal patterns; no new styles. * * @var string $scope 'platform' | 'restaurant' * @var array $rows * @var array $pager * @var array $audiences selectable audience keys for this scope * @var string $baseUrl '/admin/push-notifications' | '/vendor/push-notifications' * @var array|null $form carried-back input after a validation error */ $rows = $rows ?? []; $audiences = $audiences ?? []; $form = $form ?? null; // Human label for an audience key. Platform 'staff' = all staff; a restaurant // send's 'staff' is the vendor's own team, so it reads "My staff". $audienceLabel = static function (string $scope, string $aud): string { if ($scope === 'restaurant') { return t_raw('push.aud_my_staff'); } return t_raw('push.aud_' . $aud); }; @endphp
{!! $scope === 'restaurant' ? t('push.sub_vendor') : t('push.sub_admin') !!}
| {!! t('push.th_title') !!} | {!! t('push.th_audience') !!} | {!! t('push.th_recipients') !!} | {!! t('push.th_sent') !!} | {!! t('common.actions') !!} |
|---|---|---|---|---|
|
{{ (string) $b['title'] }}
@if (!empty($b['body'])) {{ (string) $b['body'] }} @endif
|
{!! $audienceLabel($scope, (string) $b['audience']) !!} | {!! number_format((int) $b['recipient_count']) !!} | {!! fmt_datetime($b['last_sent_at']) !!} @if ((int) $b['send_count'] > 1){!! t('push.sent_times', [':count' => (int) $b['send_count']]) !!}@endif |