1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +01:00
invoiceninja/app/Jobs/SendPushNotification.php

50 lines
929 B
PHP
Raw Normal View History

2017-01-11 14:40:13 +01:00
<?php
namespace App\Jobs;
use App\Models\Invoice;
use App\Services\PushService;
2017-01-30 20:40:43 +01:00
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
2017-01-11 14:40:13 +01:00
/**
2017-01-30 20:40:43 +01:00
* Class SendInvoiceEmail.
2017-01-11 14:40:13 +01:00
*/
class SendPushNotification extends Job implements ShouldQueue
{
use InteractsWithQueue, SerializesModels;
/**
* @var Invoice
*/
protected $invoice;
/**
* @var string
*/
protected $type;
/**
* Create a new job instance.
* @param Invoice $invoice
2017-01-30 20:49:42 +01:00
* @param mixed $type
2017-01-11 14:40:13 +01:00
*/
public function __construct($invoice, $type)
{
$this->invoice = $invoice;
$this->type = $type;
}
/**
* Execute the job.
*
* @param PushService $pushService
*/
public function handle(PushService $pushService)
{
$pushService->sendNotification($this->invoice, $this->type);
}
}