質問編集履歴
1
UserRegisterdNotifier Class 名に誤りがあった為修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -84,24 +84,24 @@
|
|
84
84
|
use Illuminate\Auth\Events\Registered;
|
85
85
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
86
86
|
use Illuminate\Queue\InteractsWithQueue;
|
87
|
-
use App\Notifications\
|
87
|
+
use App\Notifications\UserRegisterdNotifier;
|
88
88
|
use Illuminate\Support\Facades\Notification;
|
89
89
|
|
90
90
|
class UserRegisteredListener
|
91
91
|
{
|
92
92
|
public function handle(Registered $event)
|
93
93
|
{
|
94
|
-
//$event->user->notify(new
|
94
|
+
//$event->user->notify(new UserRegisterdNotifier); // 失敗
|
95
95
|
// 以下成功
|
96
96
|
Notification::route('mail', $event->user->email)
|
97
97
|
->route('slack', config('app.slack_webhook_url'))
|
98
|
-
->notify(new
|
98
|
+
->notify(new UserRegisterdNotifier);
|
99
99
|
}
|
100
100
|
}
|
101
101
|
|
102
102
|
```
|
103
103
|
|
104
|
-
app/Notifications/
|
104
|
+
app/Notifications/UserRegisterdNotifier.php
|
105
105
|
|
106
106
|
```PHP
|
107
107
|
<?php
|
@@ -115,7 +115,7 @@
|
|
115
115
|
use Illuminate\Notifications\Notification;
|
116
116
|
use App\Models\User;
|
117
117
|
|
118
|
-
class
|
118
|
+
class UserRegisterdNotifier extends Notification implements ShouldQueue
|
119
119
|
{
|
120
120
|
use Queueable;
|
121
121
|
|