PHP code example of moataz-01 / filament-notification-sound

1. Go to this page and download the library: Download moataz-01/filament-notification-sound library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

moataz-01 / filament-notification-sound example snippets


use Moataz01\FilamentNotificationSound\FilamentNotificationSoundPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        // ...
        ->plugins([
            FilamentNotificationSoundPlugin::make(),
        ]);
}

use Moataz01\FilamentNotificationSound\FilamentNotificationSoundPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        // ...
        ->plugins([
            FilamentNotificationSoundPlugin::make()
                ->soundPath('/sounds/custom-notification.mp3') // Custom sound path
                ->volume(0.5) // Volume (0.0 to 1.0)
                ->showAnimation(true) // Show animation on notification badge
                ->enabled(true), // Enable/disable the plugin
        ]);
}

FilamentNotificationSoundPlugin::make()
    ->soundPath('/sounds/my-sound.mp3')
bash
php artisan vendor:publish --tag="filament-notification-sound-config"
bash
php artisan vendor:publish --tag="filament-notification-sound-sounds"