From afaa0c237ac3c4a20640e510d3a2a53ee29a2681 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?U=C4=9EURCAN=20YA=C5=9E?= <97681426+uydevops@users.noreply.github.com> Date: Tue, 1 Oct 2024 14:31:58 +0300 Subject: [PATCH] feat: Enhance notification configuration with theme options, sound support, and localization --- config/notify.php | 48 +++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 44 insertions(+), 4 deletions(-) diff --git a/config/notify.php b/config/notify.php index 3af36a3..3d1ae48 100644 --- a/config/notify.php +++ b/config/notify.php @@ -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. | */ @@ -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), /* |-------------------------------------------------------------------------- @@ -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 ], ];