pixelfed/app/Jobs/PushNotificationPipeline/FollowPushNotifyPipeline.php

39 lines
766 B
PHP
Raw Normal View History

2024-09-30 10:43:58 +00:00
<?php
namespace App\Jobs\PushNotificationPipeline;
use App\Services\NotificationAppGatewayService;
use Exception;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Queue\Queueable;
class FollowPushNotifyPipeline 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, 'follow', $this->actor);
} catch (Exception $e) {
return;
}
}
}