Skip to content

toPushNotification not trigger #82

@NicoCascella

Description

@NicoCascella

I'm trying to use pusher-push-notifications in Laravel 11, with a Vue 3 SPA, in a separate project. If I try to make the call with a Curl or an Http request, the notification is successful. The problem arises when I try to use the pusher-push-notifications functionalities.

`
$user = \App\Models\User::find(136);
$notifica = 'notifica';
try {
// $user->notify( new TestNotification($notifica));
\Illuminate\Support\Facades\Notification::send(User::all(), new TestNotification($notifica));

} catch (\Exception $e) {
    dd($e->getMessage());
}

notifica = $notifica; } /** * Get the notification's delivery channels. * * @return array */ public function via(object $notifiable): array { return [PusherChannel::class ]; } public function toPushNotification($notifiable) { return PusherMessage::create() ->web() ->link(env('SPA_URL')) ->title('Titolo notifica') ->sound('success') ->body("Your {$notifiable->service} account was approved!"); } } ` Basically, the notification's via() method doesn't lead me to the next toPushNotification and therefore doesn't send the notification. Does anyone have any solutions?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions