Files
Nexora/app/Jobs/ProcessDocumentUpload.php
Javi 356f56eebd
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
first commit
2025-04-23 00:14:33 +06:00

27 lines
662 B
PHP

<?php
namespace App\Jobs;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Queue\Queueable;
class ProcessDocumentUpload implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
public function __construct(public Document $document, public UploadedFile $file)
{
}
public function handle()
{
// Lógica para procesar el archivo
$this->document->createVersion($this->file);
// Generar miniaturas si es imagen
if (Str::startsWith($this->file->getMimeType(), 'image/')) {
$this->document->generateThumbnails();
}
}
}