Skip to content

Commit 6b06f57

Browse files
committed
pass AnonymousNotifiable in construct
1 parent df2392b commit 6b06f57

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

app/Listeners/SendTelegramNewArticleNotification.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,12 @@
88

99
final class SendTelegramNewArticleNotification
1010
{
11+
public function __construct(
12+
private AnonymousNotifiable $notifiable
13+
) {}
14+
1115
public function handle(ArticleWasCreated $event): void
1216
{
13-
(new AnonymousNotifiable())->notify(new ArticleSubmitted($event->article));
17+
$this->notifiable->notify(new ArticleSubmitted($event->article));
1418
}
1519
}

0 commit comments

Comments
 (0)