Notification.php 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. namespace Illuminate\Support\Facades;
  3. use Illuminate\Notifications\ChannelManager;
  4. use Illuminate\Notifications\AnonymousNotifiable;
  5. use Illuminate\Support\Testing\Fakes\NotificationFake;
  6. /**
  7. * @method static void send(\Illuminate\Support\Collection|array|mixed $notifiables, $notification)
  8. * @method static void sendNow(\Illuminate\Support\Collection|array|mixed $notifiables, $notification)
  9. * @method static mixed channel(string|null $name = null)
  10. *
  11. * @see \Illuminate\Notifications\ChannelManager
  12. */
  13. class Notification extends Facade
  14. {
  15. /**
  16. * Replace the bound instance with a fake.
  17. *
  18. * @return \Illuminate\Support\Testing\Fakes\NotificationFake
  19. */
  20. public static function fake()
  21. {
  22. static::swap($fake = new NotificationFake);
  23. return $fake;
  24. }
  25. /**
  26. * Begin sending a notification to an anonymous notifiable.
  27. *
  28. * @param string $channel
  29. * @param mixed $route
  30. * @return \Illuminate\Notifications\AnonymousNotifiable
  31. */
  32. public static function route($channel, $route)
  33. {
  34. return (new AnonymousNotifiable)->route($channel, $route);
  35. }
  36. /**
  37. * Get the registered name of the component.
  38. *
  39. * @return string
  40. */
  41. protected static function getFacadeAccessor()
  42. {
  43. return ChannelManager::class;
  44. }
  45. }