| 1 | <?php |
||
| 11 | trait NotifiableTrait |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * Determines if notifiable entity should receive the notification by checking in notification settings. |
||
| 15 | * @param NotificationInterface $notification |
||
| 16 | * @return bool |
||
| 17 | */ |
||
| 18 | public function shouldReceiveNotification(NotificationInterface $notification) |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Send notifications via email by default |
||
| 29 | * @return array |
||
| 30 | */ |
||
| 31 | public function viaChannels() |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Return the notification routing information for the given channel. |
||
| 38 | * ```php |
||
| 39 | * public function routeNotificationForMail() { |
||
| 40 | * return $this->email; |
||
| 41 | * } |
||
| 42 | * ``` |
||
| 43 | * @param $channel string |
||
| 44 | * @return mixed |
||
| 45 | */ |
||
| 46 | public function routeNotificationFor($channel) |
||
| 58 | } |
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: