Use queues for notifications #1154 (#1174)

* Use queues for notifications #1154

* Styles

* Update defaults

* Include queueworker
This commit is contained in:
Nabeel S
2021-05-20 11:54:07 -04:00
committed by GitHub
parent edcea258ce
commit e7bbd6cccb
20 changed files with 232 additions and 15 deletions

View File

@@ -0,0 +1,32 @@
<?php
namespace App\Console\Commands;
use App;
use App\Contracts\Command;
class EmailTest extends Command
{
protected $signature = 'phpvms:email-test';
protected $description = 'Send a test notification to admins';
/**
* Run dev related commands
*
* @throws \Symfony\Component\HttpFoundation\File\Exception\FileException
*/
public function handle()
{
/** @var App\Notifications\EventHandler $eventHandler */
$eventHandler = app(App\Notifications\EventHandler::class);
$news = new App\Models\News();
$news->user_id = 1;
$news->subject = 'Test News';
$news->body = 'Test Body';
$news->save();
$newsEvent = new App\Events\NewsAdded($news);
$eventHandler->onNewsAdded($newsEvent);
}
}