Laravel Livewire queues Serialization is not allowed

I try to load multiple images through the laravel queue as follows:

Controller:

foreach ($this->imagenes as $pathGaleria) {

        $imagenes = $pathGaleria;
        $nombre = Str::random(10) . $imagenes->getClientOriginalName();

        $ruta = public_path() . '\imagenesPropiedades/' . $nombre;

        dispatch(new ProcesarImagenes($pathGaleria, $ruta));

        $img = imgPropiedades::create([
            'url' => '/imagenesPropiedades/' . $nombre,
            'property_id' => $this->propiedadId
        ]);
    }

Job:

public $pathGaleria;
public $ruta;

/**
 * Create a new job instance.
 *
 * @return void
 */
public function __construct($pathGaleria, $ruta)
{
    $this->pathGaleria = $pathGaleria;
    $this->ruta = $ruta;
}

/**
 * Execute the job.
 *
 * @return void
 */
public function handle()
{
    $img = $this->pathGaleria;
    $rut = $this->ruta;
    //make recibe la imagen
    Image::make($img)
    ->resize(800, null, function ($constraint) {
        $constraint->aspectRatio();
    })
    ->save($rut);
}

I get the following error: Serialization of ‘Livewire\TemporaryUploadedFile’ is not allowed.

Any suggestion will be of great value to me.

Store the file to permanent storage before creating the job and only pass the path to the job not the whole image.

Something like that?

$galeria = [

                'imagenesGaleria' => $pathGaleria->getRealPath(),

                'ruta' => $ruta

            ];

            dispatch(new ProcesarImagenes($galeria));

I’d appreciate a more complete indication if it’s not too much of a hassle.

Have you fixed the problem?