spinyman / laravel-will-queue
Installs: 177
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
pkg:composer/spinyman/laravel-will-queue
Requires
- php: ~5.6|~7.0
- illuminate/support: ~5.1
This package is auto-updated.
Last update: 2025-10-17 07:05:24 UTC
README
This package gives you ability to change notification type (instant or via queue) dynamically.
Install
Via Composer
$ composer require spinyman/laravel-will-queue
Usage
-
First of all you have to deimplement ShouldQueue interface from all notification models:
class EmailNotification extends Notification
implements ShouldQueue -
Make changes in User model:
use Illuminate\Notifications\Notifiable;use SpinyMan\WillQueue\Notifiable;
use SpinyMan\WillQueue\Notifiable; class User extends Authenticatable { use Notifiable; ... }
-
somewhere use notify function with second optional bool param to indicate queue (true) or instant (false) notification (default: false):
$user = User::find(1); $user->notify(new EmailNotification() [, true|false]);
OR if you are really sure to notify using queue:
$user = User::find(1); $user->notifyFromQueue(new EmailNotification());