Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
namespace Illuminate\Notifications;
4
 
5
use Illuminate\Contracts\Notifications\Dispatcher;
6
use InvalidArgumentException;
7
 
8
class AnonymousNotifiable
9
{
10
    /**
11
     * All of the notification routing information.
12
     *
13
     * @var array
14
     */
15
    public $routes = [];
16
 
17
    /**
18
     * Add routing information to the target.
19
     *
20
     * @param  string  $channel
21
     * @param  mixed  $route
22
     * @return $this
23
     *
24
     * @throws \InvalidArgumentException
25
     */
26
    public function route($channel, $route)
27
    {
28
        if ($channel === 'database') {
29
            throw new InvalidArgumentException('The database channel does not support on-demand notifications.');
30
        }
31
 
32
        $this->routes[$channel] = $route;
33
 
34
        return $this;
35
    }
36
 
37
    /**
38
     * Send the given notification.
39
     *
40
     * @param  mixed  $notification
41
     * @return void
42
     */
43
    public function notify($notification)
44
    {
45
        app(Dispatcher::class)->send($this, $notification);
46
    }
47
 
48
    /**
49
     * Send the given notification immediately.
50
     *
51
     * @param  mixed  $notification
52
     * @return void
53
     */
54
    public function notifyNow($notification)
55
    {
56
        app(Dispatcher::class)->sendNow($this, $notification);
57
    }
58
 
59
    /**
60
     * Get the notification routing information for the given driver.
61
     *
62
     * @param  string  $driver
63
     * @return mixed
64
     */
65
    public function routeNotificationFor($driver)
66
    {
67
        return $this->routes[$driver] ?? null;
68
    }
69
 
70
    /**
71
     * Get the value of the notifiable's primary key.
72
     *
73
     * @return mixed
74
     */
75
    public function getKey()
76
    {
77
        //
78
    }
79
}