robertbaelde / notificationtransactions
Ability to wait with sending notifications until a specific action completes
1.0.1
2020-02-03 14:38 UTC
Requires
- php: ^7.1
- illuminate/support: *
Requires (Dev)
- orchestra/testbench: *
- phpunit/phpunit: ^7.0
This package is auto-updated.
Last update: 2025-01-29 06:13:52 UTC
README
This package holds off the sending of notifications until the transactions is commit. This is usefull if you trigger notifications inside a database transaction for example.
Installation
You can install the package via composer:
composer require robertbaelde/notificationtransactions
Usage
// Start a transaction NotificationTransaction::start(); // Trigger your notifications as usual $user->notify(new ImportantNotification()); // commit the notifications when you want to send them \NotificationTransaction::commit(); // rollback the notifications when something failed and notifications must not be send. \NotificationTransaction::rollback(); // You can also use DI instead of the Facade. $notificationTransaction = resolve(NotificationTransaction::class); $notificationTransaction->start();
Testing
composer test
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email robert@baelde.nl instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
Laravel Package Boilerplate
This package was generated using the Laravel Package Boilerplate.