src/MediaUploader.php
public function update(Media $media)
    {
        $storage = $this->filesystem->disk($media->disk);

        $media->size = $this->verifyFileSize($storage->size($media->getDiskPath()));
        $media->mime_type = $this->verifyMimeType($storage->mimeType($media->getDiskPath()));
        $media->aggregate_type = $this->inferAggregateType($media->mime_type, $media->extension);

        if ($dirty = $media->isDirty()) {
            $media->save();
        }

        return $dirty;
    }
public function update(Media $media)
    {
        $storage = $this->filesystem->disk($media->disk);

        $media->size = $this->verifyFileSize($storage->size($media->getDiskPath()));
        $media->mime_type = $this->verifyMimeType($storage->mimeType($media->getDiskPath()));
        $media->aggregate_type = $this->inferAggregateType($media->mime_type, $media->extension);

        if ($dirty = $media->isDirty()) {
            $media->save();
        }

        return $dirty;
    }
public function update ( Media $ media ) { $ storage = $ this -> filesystem -> disk ( $ media -> disk ) ; $ media -> size = $ this -> verifyFileSize ( $ storage -> size ( $ media -> getDiskPath ( ) ) ) ; $ media -> mime_type = $ this -> verifyMimeType ( $ storage -> mimeType ( $ media -> getDiskPath ( ) ) ) ; $ media -> aggregate_type = $ this -> inferAggregateType ( $ media -> mime_type , $ media -> extension ) ; if ( $ dirty = $ media -> isDirty ( ) ) { $ media -> save ( ) ; } return $ dirty ; }
Reanalyze a media record's file and adjust the aggregate type and size, if necessary.

@param  \Plank\Mediable\Media $media

@return bool Whether the model was modified
@throws \Plank\Mediable\Exceptions\MediaUpload\FileNotSupportedException
@throws \Plank\Mediable\Exceptions\MediaUpload\FileSizeException
Reanalyze a media record s file and adjust the aggregate type and size if necessary .