0
私のプロジェクトにはhttps://github.com/laravel-notification-channels/webpush がインストールされていますが、通知を送信すると何もありません。セットアップlaravel-notification-channels/webpush
class AccountApproved extends Notification {
use Queueable;
public function __construct()
{
//
}
public function via($notifiable)
{
return [WebPushChannel::class];
}
public function toArray($notifiable)
{
return [
'title' => 'Hello from Laravel!',
'body' => 'Thank you for using our application.',
'action_url' => 'https://laravel.com',
'created' => Carbon::now()->toIso8601String()
];
}
public function toWebPush($notifiable, $notification)
{
return WebPushMessage::create()
->title('Hello from Laravel!')
->icon('/notification-icon.png')
->body('Thank you for using our application.')
->action('View app', 'view_app');
}}
と私は私のコントローラに通知を呼び出す:
$when = Carbon::now();
$request->user()->notify((new AccountApproved)->delay($when));
しかし、私 - 私は、通知を作成しているhttps://laravel.com/docs/5.5/notifications
これは私のコードです:それはこれがlaravel通知文書である 仕事doesntのWebpushは機能しません。どうしましたか?コマンドラインで
php artisan queue:work
:
それは奇妙だ、PHPの職人キューそこに何らかのエラーがあるかどうかを確認していません:仕事が動作することはできませんが。数分待っても、コンソールはまだフリーズしています。私はGoogle上で解決策を得るでしょう。私は –
に戻ってくるかもしれませんが、通知を送るのは失敗し、あなたの 'laravel.log'ファイル –