1 | <?php |
||
13 | trait NotifiableTrait |
||
14 | { |
||
15 | /** |
||
16 | * Determines if notifiable entity should receive the notification by checking in notification settings. |
||
17 | * @param NotificationInterface $notification |
||
18 | * @return bool |
||
19 | */ |
||
20 | public function shouldReceiveNotification(NotificationInterface $notification) |
||
34 | |||
35 | /** |
||
36 | * Send notifications via email by default |
||
37 | * @return array |
||
38 | */ |
||
39 | public function viaChannels() |
||
43 | |||
44 | /** |
||
45 | * Return the notification routing information for the given channel. |
||
46 | * ```php |
||
47 | * public function routeNotificationForMail() { |
||
48 | * return $this->email; |
||
49 | * } |
||
50 | * ``` |
||
51 | * @param $channel string |
||
52 | * @return mixed |
||
53 | */ |
||
54 | public function routeNotificationFor($channel) |
||
68 | |||
69 | public function getNotifications() |
||
75 | |||
76 | public function getUnreadNotifications() |
||
80 | } |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: