Ich habe https://github.com/laravel-notification-channels/webpush in meinem Projekt installiert, aber wenn Benachrichtigungen senden gibt es nichts. Es funktioniert nicht Dies ist Laravel Benachrichtigungen Dokumentation: https://laravel.com/docs/5.5/notificationsWie Setup Laravel-Benachrichtigung-Kanäle/WebPush
Dies ist mein Code - Ich habe eine Benachrichtigung erstellt:
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');
}}
und ich rufe Benachrichtigung in meinem Controller:
$when = Carbon::now();
$request->user()->notify((new AccountApproved)->delay($when));
Aber ich Webpush funktioniert nicht. Was ist los mit dir?
es ist seltsam, php Handwerker Warteschlange: Arbeit kann nicht funktionieren. Nach einigen Minuten des Wartens ist die Konsole noch eingefroren. Ich werde die Lösung auf Google und ich komme wieder –
Vielleicht funktioniert es, aber das Senden von Benachrichtigungen schlägt fehl und Sie erhalten Fehler in Ihrer Datei 'laravel.log' –