public function processQueue(Model $instance, $path = null, bool $cleanup = true)
    {
        $this->setInstance($instance);

        // Determine the path to use
        $path = $path ?: $this->getQueuedFilePath();

        // Set the file for processing
        $this->addUploadedFile($path);

        // Start processing the file
        $this->save();

        // Save all updated model attributes
        $this->getInstance()->save();

        // TODO: also remove non-local files
        // Remove queued file locally
        if ($cleanup === true && realpath($path) !== false) {
            @unlink($path);
            @rmdir(dirname($path));
        }
    }
public function processQueue(Model $instance, $path = null, bool $cleanup = true)
    {
        $this->setInstance($instance);

        // Determine the path to use
        $path = $path ?: $this->getQueuedFilePath();

        // Set the file for processing
        $this->addUploadedFile($path);

        // Start processing the file
        $this->save();

        // Save all updated model attributes
        $this->getInstance()->save();

        // TODO: also remove non-local files
        // Remove queued file locally
        if ($cleanup === true && realpath($path) !== false) {
            @unlink($path);
            @rmdir(dirname($path));
        }
    }
public function processQueue ( Model $ instance , $ path = null , bool $ cleanup = true ) { $ this -> setInstance ( $ instance ) ; // Determine the path to use $ path = $ path ? : $ this -> getQueuedFilePath ( ) ; // Set the file for processing $ this -> addUploadedFile ( $ path ) ; // Start processing the file $ this -> save ( ) ; // Save all updated model attributes $ this -> getInstance ( ) -> save ( ) ; // TODO: also remove non-local files // Remove queued file locally if ( $ cleanup === true && realpath ( $ path ) !== false ) { @ unlink ( $ path ) ; @ rmdir ( dirname ( $ path ) ) ; } }
Trigger queued files for processing.

@param Model  $instance
@param string $path
@param bool   $cleanup

@return void
Trigger queued files for processing .