classes/Models/Image.php
public function populateFileMeta()
    {
        $file = $this->getAttributeValue('file');
        if (!is_a($file, UploadedFile::class)) {
            return;
        }
        $size = getimagesize($file->getPathname());
        $this->fill([
            'file_type' => $this->guessFileType($file),
            'file_size' => $file->getSize(),
            'width'     => $size[0],
            'height'    => $size[1],
        ]);
    }
public function populateFileMeta()
    {
        $file = $this->getAttributeValue('file');
        if (!is_a($file, UploadedFile::class)) {
            return;
        }
        $size = getimagesize($file->getPathname());
        $this->fill([
            'file_type' => $this->guessFileType($file),
            'file_size' => $file->getSize(),
            'width'     => $size[0],
            'height'    => $size[1],
        ]);
    }
public function populateFileMeta ( ) { $ file = $ this -> getAttributeValue ( 'file' ) ; if ( ! is_a ( $ file , UploadedFile :: class ) ) { return ; } $ size = getimagesize ( $ file -> getPathname ( ) ) ; $ this -> fill ( [ 'file_type' => $ this -> guessFileType ( $ file ) , 'file_size' => $ file -> getSize ( ) , 'width' => $ size [ 0 ] , 'height' => $ size [ 1 ] , ] ) ; }
Store file meta info in the database if a new File object is present

@return void
Store file meta info in the database if a new File object is present