36 lines
1002 B
PHP
36 lines
1002 B
PHP
<?php
|
|
|
|
namespace App\Jobs;
|
|
|
|
use App\Models\Reservation;
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
use Illuminate\Queue\InteractsWithQueue;
|
|
use Illuminate\Queue\SerializesModels;
|
|
use Illuminate\Support\Facades\Storage;
|
|
|
|
class CompositeImage implements ShouldQueue
|
|
{
|
|
use InteractsWithQueue, Queueable, SerializesModels;
|
|
|
|
public int $reservationId;
|
|
|
|
public function __construct(int $reservationId)
|
|
{
|
|
$this->reservationId = $reservationId;
|
|
}
|
|
|
|
public function handle(): void
|
|
{
|
|
$reservation = Reservation::find($this->reservationId);
|
|
if (! $reservation) {
|
|
return;
|
|
}
|
|
|
|
// Placeholder: real compositing would open master image, composite user image,
|
|
// and write back to storage. For now, write a log/placeholder file.
|
|
$path = "composite/reservation_{$reservation->id}.txt";
|
|
Storage::disk('public')->put($path, "Composited reservation {$reservation->id} at ".now());
|
|
}
|
|
}
|