Package Data | |
---|---|
Maintainer Username: | Mckenziearts |
Maintainer Contact: | monneylobe@gmail.com (Arthur Monney) |
Package Create Date: | 2019-10-26 |
Package Last Update: | 2024-11-11 |
Home Page: | |
Language: | Blade |
License: | MIT |
Last Refreshed: | 2024-11-23 03:20:28 |
Package Statistics | |
---|---|
Total Downloads: | 780,697 |
Monthly Downloads: | 23,026 |
Daily Downloads: | 612 |
Total Stars: | 1,638 |
Total Watchers: | 34 |
Total Forks: | 193 |
Total Open Issues: | 17 |
Laravel Notify is a package that lets you add custom notifications to your project. A diverse range of notification design is available and many are coming soon.
This package is still under active development. If you need Android version please try this package Aesthetic Dialogs. Happy Coding 👨🏾💻
You can install the package using composer
$ composer require mckenziearts/laravel-notify
Then add the service provider to config/app.php
. In Laravel versions 5.5 and beyond, this step can be skipped if package auto-discovery is enabled.
'providers' => [
...
Mckenziearts\Notify\LaravelNotifyServiceProvider::class
...
];
You can publish the configuration file and assets by running:
$ php artisan vendor:publish --provider='Mckenziearts\Notify\LaravelNotifyServiceProvider'
Now that we have published a few new files to our application we need to reload them with the following command:
$ composer dump-autoload
@notifyCss
@notifyJs
notify()
helper function inside your controller to set a toast notification for info, success, warning or error@include('notify::messages')
Within your controllers, before you perform a redirect call the notify
method with a message.
public function store()
{
notify()->success('Laravel Notify is awesome!');
return Redirect::home();
}
An complete example:
<!doctype html>
<html>
<head>
<title>Laravel Notify</title>
@notifyCss
</head>
<body>
@include('notify::messages')
@notifyJs
</body>
</html>
Laravel Notify actually display 4 types of notifications
toast
notification, who is default notification for Laravel Notifynotify()->success('Welcome to Laravel Notify ⚡️')
connectify
notification, example of basic usageconnectify('success', 'Connection Found', 'Success Message Here')
drakify
(😎) notification, only to display an alertdrakify('success') // for success alert
or
drakify('error') // for error alert
smilify
notification, a simple custom toast notification using smiley 😊smilify('success', 'You are successfully reconnected')
Config file are located at config/notify.php
after publishing provider element.
Some awesome stuff. To active dark mode
update the theme
config, or add global variable NOTIFY_THEME
on your .env file
'theme' => env('NOTIFY_THEME', 'dark'),
Got result like that
Laravel Notify use animate.css to set smooth animation to display and hide notify element.
/*
|--------------------------------------------------------------------------
| Animate Module (use animate.css)
|--------------------------------------------------------------------------
|
| Use animate.css to animate the notice.
|
*/
'animate' => [
'in_class' => 'bounceInRight', // The class to use to animate the notice in.
'out_class' => 'bounceOutRight', // The class to use to animate the notice out.
'timeout' => 5000 // Number of seconds before the notice disappears
],
You can now choose where the notification should appear with the position
variable in the configuration file. By default
the top-right
position is enable.
'position' => 'top-right',
Please see the changelog for more information on what has changed recently.
Please see contributing.md for details and a todolist.
If you discover any security related issues, please email author email instead of using the issue tracker.
license. Please see the license file for more information.