Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Filament Webpush Laravel Package

andrefelipe18/filament-webpush

View on GitHub
Deep Wiki
Context7

Custom Configuration

This page covers advanced configuration options for Filament Webpush.

Service Worker Customization

The default service worker is designed to handle basic push notification functionality, but you may need to customize it for your specific requirements.

Location

After running the webpush:prepare command, the service worker file is located at:

public/sw.js

WebPush JavaScript

The WebPush JavaScript file that handles subscription and notification display is located at:

resources/js/webpush.js

You can customize this file and include it in your build process.

Advanced Plugin Configuration

The Filament Webpush plugin has several configuration options:

FilamentWebpushPlugin::make()
    ->registerSubscriptionStatsWidget(true) // Show subscription stats widget

Handling Subscription Lifecycle

You can listen for subscription events in your application:

use NotificationChannels\WebPush\Events\NotificationSent;
use NotificationChannels\WebPush\Events\NotificationFailed;
use FilamentWebpush\Events\PushSubscriptionCreated;
use FilamentWebpush\Events\PushSubscriptionDeleted;

protected $listen = [
    NotificationSent::class => [
        YourNotificationSentListener::class,
    ],
    NotificationFailed::class => [
        YourNotificationFailedListener::class,
    ],
    PushSubscriptionCreated::class => [
        YourSubscriptionCreatedListener::class,
    ],
    PushSubscriptionDeleted::class => [
        YourSubscriptionDeletedListener::class,
    ],
];

Additional Configuration Options

Queue Configuration

Since Web Push notifications are queued, you may want to specify the queue they should use:

class NewPostPublished extends Notification implements ShouldQueue
{
    use Queueable;

    public $queue = 'notifications';
    // ...
}
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky