| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <?php
- namespace App\Notifications\Push\Manual;
- use App\Enums\PushNotificationCategoryEnum;
- use App\Enums\PushNotificationTargetEnum;
- use App\Notifications\Push\BasePushNotification;
- use Illuminate\Database\Eloquent\Collection;
- /**
- * Push disparada manualmente pelo backoffice: título e corpo vêm do formulário,
- * não do código. NÃO é registrada no PushNotificationDispatcher::all() — o envio
- * é sempre por chamada direta, a partir do SendManualPushJob.
- */
- class ManualPush extends BasePushNotification
- {
- public function __construct(
- private string $title,
- private string $body,
- private PushNotificationTargetEnum $target,
- ) {}
- public function label(): string
- {
- return 'manual_push';
- }
- public function title(): string
- {
- return $this->title;
- }
- public function body(): string
- {
- return $this->body;
- }
- public function target(): PushNotificationTargetEnum
- {
- return $this->target;
- }
- public function category(): PushNotificationCategoryEnum
- {
- return PushNotificationCategoryEnum::MANUAL;
- }
- public function notificationCooldownDays(): int
- {
- return 0;
- }
- public function categoryCooldownDays(): int
- {
- return 0;
- }
- public function eligibleUsers(): Collection
- {
- return new Collection();
- }
- }
|