Skip to content

How to use shorthand notation 'webpush' for the channel name in the via() method? #164

@boryn

Description

@boryn

I'd like to return ['webpush'] in the via() method instead of WebPushChannel::class.

I based on https://medium.com/@sirajul.anik/laravel-notifications-part-2-creating-a-custom-notification-channel-6b0eb0d81294 and tried to register it in the AppServiceProvider.php with:

Notification::extend('webpush', function ($app) {
    return new WebPushChannel();
});

but WebPushChannel() constructor needs additional parameters and this method fails.

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