marshmallow / nova-alertable
Add alerts and modals to your Nova installation. After creating or updating any resource. Or after running an action. Whatever you need!
Requires
- php: ^7.1|^8.0
- pusher/pusher-php-server: ~4.0
- dev-main
- v1.0.2
- v1.0.1
- v1.0.0
- dev-dependabot/npm_and_yarn/pusher-js-8.0.1
- dev-dependabot/npm_and_yarn/eslint-8.32.0
- dev-dependabot/npm_and_yarn/eslint-plugin-vue-9.9.0
- dev-dependabot/npm_and_yarn/eslint-config-prettier-8.6.0
- dev-dependabot/npm_and_yarn/vue-3.2.45
- dev-dependabot/github_actions/actions/checkout-3.1.0
- dev-dependabot/github_actions/actions/checkout-3
- dev-development
- dev-dependabot/github_actions/actions/checkout-2.3.4
This package is auto-updated.
Last update: 2024-12-19 13:26:27 UTC
README
Nova Alertable
This Nova package will make it possible to sent alert to you Nova application via Model Observers. If you want to help the user to remember that they have to do an action after they've changed a resource, this package is for you!
Installation
Composer
You can install the package in to a Laravel app that uses Nova via composer:
composer require marshmallow/alertable
Nova
Add the tool to you NovaServiceProvider
.
public function tools() { return [ // ... new \Marshmallow\Alertable\Alertable, ]; }
Routes
Make sure you have the alertable channel authenticated in routes/channels.php:
Broadcast::channel('alertable.{userId}', function ($user, $userId) { return $user->id === (int) $userId; });
Pusher
This tool uses pusher to broadcast events. Please create a free pusher account if you don't have one already.
PUSHER_APP_ID=_____ PUSHER_APP_KEY=_____ PUSHER_APP_SECRET=_____ PUSHER_APP_CLUSTER=_____
We've run into issues before when useTLS
is active in the broadcasting.php
config file. If you run into issues, pleas comment this as shown in the example below.
'connections' => [ 'pusher' => [ 'driver' => 'pusher', 'key' => env('PUSHER_APP_KEY'), 'secret' => env('PUSHER_APP_SECRET'), 'app_id' => env('PUSHER_APP_ID'), 'options' => [ 'cluster' => env('PUSHER_APP_CLUSTER'), // 'useTLS' => true, ], ], ]
Also, make sure the BroadcastServiceProvider::class
is uncommented in config/app.php
.
Set your BROADCAST_DRIVER
to pusher
in your .env
file.
BROADCAST_DRIVER=pusher
Usage
use Marshmallow\Alertable\Events\AlertNotificationEvent; event(new AlertNotificationEvent( request()->user(), $alert_message = 'This Marshmallow Package is awesome!' ));
Changelog
Please see CHANGELOG for more information what has changed recently.
Security
If you discover any security related issues, please email stef@marshmallow.dev instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.