Notification.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. * @see \Illuminate\Notifications\ChannelManager
  8. */
  9. class Notification extends Facade
  10. {
  11. /**
  12. * Replace the bound instance with a fake.
  13. *
  14. * @return \Illuminate\Support\Testing\Fakes\NotificationFake
  15. */
  16. public static function fake()
  17. {
  18. static::swap($fake = new NotificationFake);
  19. return $fake;
  20. }
  21. /**
  22. * Begin sending a notification to an anonymous notifiable.
  23. *
  24. * @param string $channel
  25. * @param mixed $route
  26. * @return \Illuminate\Notifications\AnonymousNotifiable
  27. */
  28. public static function route($channel, $route)
  29. {
  30. return (new AnonymousNotifiable)->route($channel, $route);
  31. }
  32. /**
  33. * Get the registered name of the component.
  34. *
  35. * @return string
  36. */
  37. protected static function getFacadeAccessor()
  38. {
  39. return ChannelManager::class;
  40. }
  41. }