Motivacional1Push.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. namespace App\Notifications\Push\Prestador\Motivacional;
  3. use App\Enums\ApprovalStatusEnum;
  4. use App\Enums\PushNotificationCategoryEnum;
  5. use App\Enums\PushNotificationTargetEnum;
  6. use App\Models\User;
  7. use App\Notifications\Push\BasePushNotification;
  8. use Illuminate\Database\Eloquent\Collection;
  9. class Motivacional1Push extends BasePushNotification
  10. {
  11. public function label(): string
  12. {
  13. return 'provider_motivacional_1';
  14. }
  15. public function title(): string
  16. {
  17. return 'Fique de olho 👀';
  18. }
  19. public function body(): string
  20. {
  21. return 'Novos pedidos Sob Medida surgem o tempo todo no app.';
  22. }
  23. public function target(): PushNotificationTargetEnum
  24. {
  25. return PushNotificationTargetEnum::PRESTADOR;
  26. }
  27. public function category(): PushNotificationCategoryEnum
  28. {
  29. return PushNotificationCategoryEnum::MOTIVACIONAL;
  30. }
  31. public function notificationCooldownDays(): int
  32. {
  33. return 7;
  34. }
  35. public function categoryCooldownDays(): int
  36. {
  37. return 7;
  38. }
  39. public function eligibleUsers(): Collection
  40. {
  41. return User::whereHas('provider', fn ($q) => $q->where('approval_status', ApprovalStatusEnum::ACCEPTED))
  42. ->get();
  43. }
  44. }