2020-03-05 08:14:57 +01:00
|
|
|
<?php
|
|
|
|
/**
|
2020-09-06 11:38:10 +02:00
|
|
|
* Invoice Ninja (https://invoiceninja.com).
|
2020-03-05 08:14:57 +01:00
|
|
|
*
|
|
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
|
|
*
|
|
|
|
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
|
|
|
|
*
|
|
|
|
* @license https://opensource.org/licenses/AAL
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace App\Jobs\Util;
|
|
|
|
|
|
|
|
use App\Models\Company;
|
2020-09-06 11:38:10 +02:00
|
|
|
use App\Utils\Traits\Pdf\PdfMaker;
|
2020-03-05 08:14:57 +01:00
|
|
|
use Illuminate\Bus\Queueable;
|
|
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
|
|
use Illuminate\Foundation\Bus\Dispatchable;
|
|
|
|
use Illuminate\Queue\InteractsWithQueue;
|
|
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
|
2020-03-21 06:37:30 +01:00
|
|
|
class PreviewPdf implements ShouldQueue
|
|
|
|
{
|
2020-07-05 12:58:30 +02:00
|
|
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels, PdfMaker;
|
2020-03-05 08:14:57 +01:00
|
|
|
|
2020-03-21 06:37:30 +01:00
|
|
|
public $company;
|
2020-03-05 08:14:57 +01:00
|
|
|
|
2020-03-21 06:37:30 +01:00
|
|
|
private $disk;
|
2020-03-05 08:14:57 +01:00
|
|
|
|
2020-03-21 06:37:30 +01:00
|
|
|
public $design_string;
|
2020-03-05 08:14:57 +01:00
|
|
|
|
2020-03-21 06:37:30 +01:00
|
|
|
/**
|
|
|
|
* Create a new job instance.
|
|
|
|
*
|
2020-10-28 11:10:49 +01:00
|
|
|
* @param $design_string
|
|
|
|
* @param Company $company
|
2020-03-21 06:37:30 +01:00
|
|
|
*/
|
|
|
|
public function __construct($design_string, Company $company)
|
|
|
|
{
|
|
|
|
$this->company = $company;
|
2020-03-05 08:14:57 +01:00
|
|
|
|
2020-03-21 06:37:30 +01:00
|
|
|
$this->design_string = $design_string;
|
2020-03-05 08:14:57 +01:00
|
|
|
|
|
|
|
$this->disk = $disk ?? config('filesystems.default');
|
2020-03-21 06:37:30 +01:00
|
|
|
}
|
2020-03-05 08:14:57 +01:00
|
|
|
|
2020-03-21 06:37:30 +01:00
|
|
|
public function handle()
|
|
|
|
{
|
2020-07-05 12:58:30 +02:00
|
|
|
return $this->makePdf(null, null, $this->design_string);
|
2020-03-21 06:37:30 +01:00
|
|
|
}
|
2020-03-05 08:14:57 +01:00
|
|
|
}
|