Add LikePushNotificationPipeline

This commit is contained in:
Daniel Supernault 2024-09-30 05:00:12 -06:00
parent 7b4256549a
commit c95e757731
No known key found for this signature in database
GPG key ID: 23740873EE6F76A1

View file

@ -0,0 +1,38 @@
<?php
namespace App\Jobs\PushNotificationPipeline;
use App\Services\NotificationAppGatewayService;
use Exception;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Queue\Queueable;
class LikePushNotifyPipeline implements ShouldQueue
{
use Queueable;
public $pushToken;
public $actor;
/**
* Create a new job instance.
*/
public function __construct($pushToken, $actor)
{
$this->pushToken = $pushToken;
$this->actor = $actor;
}
/**
* Execute the job.
*/
public function handle(): void
{
try {
NotificationAppGatewayService::send($this->pushToken, 'like', $this->actor);
} catch (Exception $e) {
return;
}
}
}