richard
/
cyca
Archived
1
0
Fork 0
This repository has been archived on 2024-02-08. You can view files and clone it, but cannot push or open issues/pull-requests.
cyca/app/Jobs/EnqueueDocumentUpdate.php

52 lines
1007 B
PHP
Executable File

<?php
namespace App\Jobs;
use App\Models\Document;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldBeUnique;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Str;
class EnqueueDocumentUpdate implements ShouldQueue
{
use Dispatchable;
use InteractsWithQueue;
use Queueable;
use SerializesModels;
/**
* Delete the job if its models no longer exist.
*
* @var bool
*/
public $deleteWhenMissingModels = true;
/**
* Document to update.
*
* @var \App\Models\Document
*/
protected $document;
/**
* Create a new job instance.
*/
public function __construct(Document $document)
{
$this->document = $document;
}
/**
* Execute the job.
*/
public function handle()
{
$this->document->analyze();
$this->document = null;
}
}