PHP code example of blemli / filament-audiofeedback
1. Go to this page and download the library: Download blemli/filament-audiofeedback 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/ */
blemli / filament-audiofeedback example snippets
use Blemli\AudioFeedback\AudioFeedbackPlugin;
public function panel(Panel $panel): Panel
{
return $panel
// ...
->plugin(AudioFeedbackPlugin::make());
}
// config/audiofeedback.php
return [
'enabled' => env('AUDIOFEEDBACK_ENABLED', true),
// Master volume, 0–100. Users can pick their own (see below).
'volume' => 50,
// The mute button is shown by default; opt out with false.
'mute_toggle' => true,
// 'topbar-start', 'topbar-end', 'user-menu-before' or 'user-menu'.
'mute_toggle_position' => 'user-menu-before',
// Opt in to a per-user "Sounds" section on Breezy's my-profile page.
'breezy_profile_section' => false,
// Any of: chime, sparkle, droplet, bloom, whisper, tick, press,
// release, toggle, success, error, page, loading, ready — or false.
'sounds' => [
'notification.success' => 'success',
'toggle' => 'toggle',
'nav.hover' => false, // silence a single event
// ...
],
];
use Blemli\AudioFeedback\AudioFeedbackPlugin;
public function boot(): void
{
AudioFeedbackPlugin::configureUsing(
fn (AudioFeedbackPlugin $plugin) => $plugin->sound('login', 'bloom'),
);
}
Notification::make()
->title('Saved')
->success()
->sound('sparkle') // override the status sound
->send();
Notification::make()
->title('Autosaved')
->silent() // no sound for this one
->send();
Notification::make()
->title('Gone')
->soundEvent('delete') // play a configured event's sound instead
->send();
use Blemli\AudioFeedback\MuteTogglePosition;
AudioFeedbackPlugin::make()->muteToggle(position: MuteTogglePosition::UserMenu);