mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-15 02:54:30 +00:00
39 lines
762 B
PHP
39 lines
762 B
PHP
|
<?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;
|
||
|
}
|
||
|
}
|
||
|
}
|