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

Ability to set custom timeout for individual notification #117

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,33 +100,33 @@ Laravel Notify actually display 5 types of notifications
1. `toast` notification, (The default notification for Laravel Notify)

```php
notify()->success('Welcome to Laravel Notify ⚡️') or notify()->success('Welcome to Laravel Notify ⚡️', 'My custom title')
notify()->success('Welcome to Laravel Notify ⚡️') or notify()->success('Welcome to Laravel Notify ⚡️', 'My custom title') or notify()->success('Welcome to Laravel Notify ⚡️', 'My custom title', 5000)
```

2. `connectify` notification, example of basic usage

```php
connectify('success', 'Connection Found', 'Success Message Here')
connectify('success', 'Connection Found', 'Success Message Here') or connectify('success', 'Connection Found', 'Success Message Here', 5000)
```

3. `drakify` (😎) notification, displays an alert only

```php
drakify('success') // for success alert
drakify('success') or drakify('success', 5000) // for success alert
or
drakify('error') // for error alert
drakify('error') or drakify('error', 5000) // for error alert
```

4. `smilify` notification, displays a simple custom toast notification using the smiley (😊) emoticon

```php
smilify('success', 'You are successfully reconnected')
smilify('success', 'You are successfully reconnected') or smilify('success', 'You are successfully reconnected', 5000)
```

5. `emotify` notification, displays a simple custom toast notification using a vector emoticon

```php
emotify('success', 'You are awesome, your data was successfully created')
emotify('success', 'You are awesome, your data was successfully created') or emotify('success', 'You are awesome, your data was successfully created', 5000)
```

#### Preset Notifications
Expand Down Expand Up @@ -173,12 +173,14 @@ You can define preset notifications in the config file using the following struc
'type' => 'success',
'model' => 'connect',
'title' => 'User Updated',
'timeout' => 5000,
],
'user-deleted' => [
'message' => 'The user has been deleted successfully.',
'type' => 'success',
'model' => 'connect',
'title' => 'User Deleted',
'timeout' => 5000,
],
],
```
Expand Down
6 changes: 6 additions & 0 deletions config/notify.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
|
| Defines the number of seconds during which the notification will be visible.
|
| You can also define an array of timeout for each type of notification such as:
| ['error' => 10000, 'default' => 5000]
| Here the error notification will be visible for 10 seconds and all other
| notifications type for 5 seconds.
|
*/

'timeout' => 5000,
Expand All @@ -43,6 +48,7 @@
'type' => 'success',
'model' => 'connect',
'title' => 'User Updated',
'timeout' => 5000,
],
],

Expand Down
Loading