### Install via Composer Source: https://github.com/benriadh1/filament-notification-bell/blob/main/README.md Run this command in your terminal to add the package to your project. ```bash composer require benriadh1/filament-notification-bell ``` -------------------------------- ### Define Language File Structure Source: https://github.com/benriadh1/filament-notification-bell/blob/main/README.md Example structure for a custom language file override. ```php // resources/lang/vendor/filament-notification-bell/it/notification-bell.php return [ 'title' => 'Notification', 'mark_all_read' => '', // ... all keys ]; ``` -------------------------------- ### Publish and run migrations Source: https://github.com/benriadh1/filament-notification-bell/blob/main/README.md Publish the necessary migration files and apply them to your database. ```bash php artisan vendor:publish --tag="filament-notification-bell-migrations" php artisan migrate ``` -------------------------------- ### Publish Plugin Views Source: https://github.com/benriadh1/filament-notification-bell/blob/main/README.md Run this command to copy the plugin views to your application for customization. ```bash php artisan vendor:publish --tag="filament-notification-bell-views" ``` -------------------------------- ### Publish configuration file Source: https://github.com/benriadh1/filament-notification-bell/blob/main/README.md Run this command to publish the package configuration file to your application's config directory. ```bash php artisan vendor:publish --tag="filament-notification-bell-config" ``` -------------------------------- ### Configure RTL Support Source: https://github.com/benriadh1/filament-notification-bell/blob/main/README.md Enable RTL support either globally via the configuration file or specifically via the fluent API. ```php // In config/filament-notification-bell.php 'rtl_locales' => ['ar', 'fa', 'he', 'ur', 'ug'], // Or via fluent plugin API FilamentNotificationBellPlugin::make()->rtl() ``` -------------------------------- ### Create a feature branch Source: https://github.com/benriadh1/filament-notification-bell/blob/main/README.md Use this command to create and switch to a new feature branch. ```bash git checkout -b feat/my-feature ``` -------------------------------- ### Register the plugin Source: https://github.com/benriadh1/filament-notification-bell/blob/main/README.md Add the plugin to your Filament panel configuration in your Panel provider. ```php use Benriadh1\FilamentNotificationBell\FilamentNotificationBellPlugin; public function panel(Panel $panel): Panel { return $panel // ... your other panel config ->plugin(FilamentNotificationBellPlugin::make()); } ``` -------------------------------- ### FilamentNotificationBellPlugin::make() Source: https://github.com/benriadh1/filament-notification-bell/blob/main/README.md The entry point for configuring the notification bell plugin using a fluent interface. ```APIDOC ## FilamentNotificationBellPlugin::make() ### Description Initializes the plugin configuration. All options can be chained fluently. ### Methods - **limit(int $limit)**: Sets the maximum number of notifications to display. - **slideOver()**: Configures the notification display to use a slide-over panel. - **dropdown()**: Configures the notification display to use a dropdown (default). - **withPolling(int $seconds)**: Enables automatic polling for new notifications at the specified interval. - **locale(string $locale)**: Forces a specific locale for the plugin. - **rtl()**: Forces Right-to-Left layout. - **lightMode()**: Forces light mode theme. - **darkMode()**: Forces dark mode theme. - **autoTheme()**: Sets theme to follow the Filament panel setting (default). - **usePusher()**: Configures the plugin to use Pusher for real-time updates. - **useReverb()**: Configures the plugin to use Reverb for real-time updates (default). ``` -------------------------------- ### Publish CSS assets Source: https://github.com/benriadh1/filament-notification-bell/blob/main/README.md Publish the required CSS assets for the notification bell. ```bash php artisan vendor:publish --tag="filament-notification-bell-assets" ``` -------------------------------- ### Configure Filament Notification Bell via Fluent API Source: https://github.com/benriadh1/filament-notification-bell/blob/main/README.md Use the fluent API during plugin registration to set limits, UI behavior, polling, locale, and theme preferences. ```php FilamentNotificationBellPlugin::make() ->limit(30) ->slideOver() // or ->dropdown() (default) ->withPolling(60) // enable polling every 60 seconds ->locale('fr') // force French locale ->rtl() // force RTL layout ->lightMode() // or ->darkMode() or ->autoTheme() (default) ->usePusher() // or ->useReverb() (default) ``` -------------------------------- ### Configure Theme Modes Source: https://github.com/benriadh1/filament-notification-bell/blob/main/README.md Explicitly set the theme mode for the notification bell component. ```php FilamentNotificationBellPlugin::make()->lightMode() ``` ```php FilamentNotificationBellPlugin::make()->darkMode() ``` ```php FilamentNotificationBellPlugin::make()->autoTheme() ``` -------------------------------- ### Enable real-time broadcasting Source: https://github.com/benriadh1/filament-notification-bell/blob/main/README.md Add the HasNotificationBell trait to your User model to support real-time updates. ```php use Benriadh1\FilamentNotificationBell\Concerns\HasNotificationBell; class User extends Authenticatable { use HasNotificationBell; } ``` -------------------------------- ### Publish Language Files Source: https://github.com/benriadh1/filament-notification-bell/blob/main/README.md Publish the translation files to your application to allow for overrides or new language additions. ```bash php artisan vendor:publish --tag="filament-notification-bell-lang" ``` -------------------------------- ### Define a notification Source: https://github.com/benriadh1/filament-notification-bell/blob/main/README.md Create a notification class that returns data in the format expected by the plugin. ```php use Illuminate\Notifications\Notification; use Illuminate\Notifications\Messages\DatabaseMessage; class OrderShipped extends Notification { public function via($notifiable): array { return ['database']; } public function toDatabase($notifiable): array { return [ 'title' => 'Order Shipped', 'body' => 'Your order #1234 has been shipped.', 'url' => route('orders.show', 1234), 'type' => 'success', // 'info' | 'success' | 'warning' | 'error' ]; } } ``` -------------------------------- ### Push changes Source: https://github.com/benriadh1/filament-notification-bell/blob/main/README.md Push the feature branch to the remote repository. ```bash git push origin feat/my-feature ``` -------------------------------- ### Commit changes Source: https://github.com/benriadh1/filament-notification-bell/blob/main/README.md Commit your changes using the conventional commit format. ```bash git commit -m "feat: add my feature" ``` -------------------------------- ### Force Specific Locale Source: https://github.com/benriadh1/filament-notification-bell/blob/main/README.md Set the plugin locale programmatically via the fluent API. ```php FilamentNotificationBellPlugin::make()->locale('fr') ``` -------------------------------- ### Send a notification Source: https://github.com/benriadh1/filament-notification-bell/blob/main/README.md Trigger the notification using the standard Laravel notify method. ```php $user->notify(new OrderShipped()); ``` -------------------------------- ### Override Translation Keys Source: https://github.com/benriadh1/filament-notification-bell/blob/main/README.md Return an array of custom translation strings in the published language file. ```php return [ 'title' => 'My Custom Title', // ... ]; ``` -------------------------------- ### Broadcast notification Source: https://github.com/benriadh1/filament-notification-bell/blob/main/README.md Call notifyBell after sending a notification to trigger the real-time event. ```php $user->notify(new OrderShipped()); $user->notifyBell(); // broadcasts the NotificationSent event via Reverb ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.