Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Enhance notification configuration with theme options, sound support, and localization #129

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 44 additions & 4 deletions config/notify.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
|--------------------------------------------------------------------------
|
| You can change the theme of notifications by specifying the desired theme.
| By default the theme light is activated, but you can change it by
| specifying the dark mode. To change theme, update the global variable to `dark`
| Default themes available: light, dark, colorful, minimal.
|
*/

Expand All @@ -21,10 +20,11 @@
|--------------------------------------------------------------------------
|
| Defines the number of seconds during which the notification will be visible.
| You can set a default timeout or customize for each message type.
|
*/

'timeout' => 5000,
'timeout' => env('NOTIFY_TIMEOUT', 5000),

/*
|--------------------------------------------------------------------------
Expand All @@ -37,13 +37,53 @@
*/

'preset-messages' => [
// An example preset 'user updated' Connectify notification.
'user-updated' => [
'message' => 'The user has been updated successfully.',
'type' => 'success',
'model' => 'connect',
'title' => 'User Updated',
'timeout' => 5000, // Specific timeout for this message
],
'user-deleted' => [
'message' => 'The user has been deleted successfully.',
'type' => 'error',
'model' => 'toast',
'title' => 'User Deleted',
'timeout' => 3000, // Shorter timeout for error messages
],
'info-message' => [
'message' => 'This is an informational message.',
'type' => 'info',
'model' => 'drake',
'title' => 'Information',
],
],

/*
|--------------------------------------------------------------------------
| Sound Notifications
|--------------------------------------------------------------------------
|
| Define whether to enable sound notifications for alerts.
| This can enhance user experience by providing audible alerts.
|
*/

'sound' => env('NOTIFY_SOUND', true), // Default to true

/*
|--------------------------------------------------------------------------
| Localization Support
|--------------------------------------------------------------------------
|
| Enable localization support for notifications.
| Specify the default language for messages.
|
*/

'localization' => [
'default' => env('NOTIFY_LANGUAGE', 'en'),
'supported' => ['en', 'tr', 'fr', 'es'], // Add more languages as needed
],

];