| 148 |
lars |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
namespace Illuminate\Support\Facades;
|
|
|
4 |
|
|
|
5 |
use Illuminate\Notifications\AnonymousNotifiable;
|
|
|
6 |
use Illuminate\Notifications\ChannelManager;
|
|
|
7 |
use Illuminate\Support\Testing\Fakes\NotificationFake;
|
|
|
8 |
|
|
|
9 |
/**
|
|
|
10 |
* @method static void send(\Illuminate\Support\Collection|array|mixed $notifiables, mixed $notification)
|
|
|
11 |
* @method static void sendNow(\Illuminate\Support\Collection|array|mixed $notifiables, mixed $notification, array|null $channels = null)
|
|
|
12 |
* @method static mixed channel(string|null $name = null)
|
|
|
13 |
* @method static string getDefaultDriver()
|
|
|
14 |
* @method static string deliversVia()
|
|
|
15 |
* @method static void deliverVia(string $channel)
|
|
|
16 |
* @method static \Illuminate\Notifications\ChannelManager locale(string $locale)
|
|
|
17 |
* @method static mixed driver(string|null $driver = null)
|
|
|
18 |
* @method static \Illuminate\Notifications\ChannelManager extend(string $driver, \Closure $callback)
|
|
|
19 |
* @method static array getDrivers()
|
|
|
20 |
* @method static \Illuminate\Contracts\Container\Container getContainer()
|
|
|
21 |
* @method static \Illuminate\Notifications\ChannelManager setContainer(\Illuminate\Contracts\Container\Container $container)
|
|
|
22 |
* @method static \Illuminate\Notifications\ChannelManager forgetDrivers()
|
|
|
23 |
* @method static void assertSentOnDemand(string|\Closure $notification, callable|null $callback = null)
|
|
|
24 |
* @method static void assertSentTo(mixed $notifiable, string|\Closure $notification, callable|null $callback = null)
|
|
|
25 |
* @method static void assertSentOnDemandTimes(string $notification, int $times = 1)
|
|
|
26 |
* @method static void assertSentToTimes(mixed $notifiable, string $notification, int $times = 1)
|
|
|
27 |
* @method static void assertNotSentTo(mixed $notifiable, string|\Closure $notification, callable|null $callback = null)
|
|
|
28 |
* @method static void assertNothingSent()
|
|
|
29 |
* @method static void assertNothingSentTo(mixed $notifiable)
|
|
|
30 |
* @method static void assertSentTimes(string $notification, int $expectedCount)
|
|
|
31 |
* @method static void assertCount(int $expectedCount)
|
|
|
32 |
* @method static \Illuminate\Support\Collection sent(mixed $notifiable, string $notification, callable|null $callback = null)
|
|
|
33 |
* @method static bool hasSent(mixed $notifiable, string $notification)
|
|
|
34 |
* @method static array sentNotifications()
|
|
|
35 |
* @method static void macro(string $name, object|callable $macro)
|
|
|
36 |
* @method static void mixin(object $mixin, bool $replace = true)
|
|
|
37 |
* @method static bool hasMacro(string $name)
|
|
|
38 |
* @method static void flushMacros()
|
|
|
39 |
*
|
|
|
40 |
* @see \Illuminate\Notifications\ChannelManager
|
|
|
41 |
* @see \Illuminate\Support\Testing\Fakes\NotificationFake
|
|
|
42 |
*/
|
|
|
43 |
class Notification extends Facade
|
|
|
44 |
{
|
|
|
45 |
/**
|
|
|
46 |
* Replace the bound instance with a fake.
|
|
|
47 |
*
|
|
|
48 |
* @return \Illuminate\Support\Testing\Fakes\NotificationFake
|
|
|
49 |
*/
|
|
|
50 |
public static function fake()
|
|
|
51 |
{
|
|
|
52 |
static::swap($fake = new NotificationFake);
|
|
|
53 |
|
|
|
54 |
return $fake;
|
|
|
55 |
}
|
|
|
56 |
|
|
|
57 |
/**
|
|
|
58 |
* Begin sending a notification to an anonymous notifiable.
|
|
|
59 |
*
|
|
|
60 |
* @param string $channel
|
|
|
61 |
* @param mixed $route
|
|
|
62 |
* @return \Illuminate\Notifications\AnonymousNotifiable
|
|
|
63 |
*/
|
|
|
64 |
public static function route($channel, $route)
|
|
|
65 |
{
|
|
|
66 |
return (new AnonymousNotifiable)->route($channel, $route);
|
|
|
67 |
}
|
|
|
68 |
|
|
|
69 |
/**
|
|
|
70 |
* Get the registered name of the component.
|
|
|
71 |
*
|
|
|
72 |
* @return string
|
|
|
73 |
*/
|
|
|
74 |
protected static function getFacadeAccessor()
|
|
|
75 |
{
|
|
|
76 |
return ChannelManager::class;
|
|
|
77 |
}
|
|
|
78 |
}
|