public function setUploadedFile(StorableFileInterface $file)
    {
        $this->instance->markAttachmentUpdated();

        if ( ! $this->config->keepOldFiles()) {
            $this->clear();
        }

        $this->clearTarget();

        $this->uploadedFile = $file;

        // Update the model instance with appropriate column values
        $this->instanceWrite('file_name', $this->uploadedFile->name());
        $this->instanceWrite('file_size', $this->uploadedFile->size());
        $this->instanceWrite('content_type', $this->uploadedFile->mimeType());
        $this->instanceWrite('updated_at', Carbon::now());

        $this->performCallableHookBeforeProcessing();

        $this->queueAllForWrite();
    }
public function setUploadedFile(StorableFileInterface $file)
    {
        $this->instance->markAttachmentUpdated();

        if ( ! $this->config->keepOldFiles()) {
            $this->clear();
        }

        $this->clearTarget();

        $this->uploadedFile = $file;

        // Update the model instance with appropriate column values
        $this->instanceWrite('file_name', $this->uploadedFile->name());
        $this->instanceWrite('file_size', $this->uploadedFile->size());
        $this->instanceWrite('content_type', $this->uploadedFile->mimeType());
        $this->instanceWrite('updated_at', Carbon::now());

        $this->performCallableHookBeforeProcessing();

        $this->queueAllForWrite();
    }
public function setUploadedFile ( StorableFileInterface $ file ) { $ this -> instance -> markAttachmentUpdated ( ) ; if ( ! $ this -> config -> keepOldFiles ( ) ) { $ this -> clear ( ) ; } $ this -> clearTarget ( ) ; $ this -> uploadedFile = $ file ; // Update the model instance with appropriate column values $ this -> instanceWrite ( 'file_name' , $ this -> uploadedFile -> name ( ) ) ; $ this -> instanceWrite ( 'file_size' , $ this -> uploadedFile -> size ( ) ) ; $ this -> instanceWrite ( 'content_type' , $ this -> uploadedFile -> mimeType ( ) ) ; $ this -> instanceWrite ( 'updated_at' , Carbon :: now ( ) ) ; $ this -> performCallableHookBeforeProcessing ( ) ; $ this -> queueAllForWrite ( ) ; }
Sets a file to be processed and stored.

This is not done instantly. Rather, the file is queued for processing when the model is saved.

@param StorableFileInterface $file
Sets a file to be processed and stored .