src/Dispatcher.php
public function attach(array $files)
    {
        foreach ($files as $key => $file) {
            if (is_array($file)) {
                $file = new UploadedFile($file['path'], basename($file['path']), $file['mime'], $file['size']);
            } elseif (is_string($file)) {
                $finfo = finfo_open(FILEINFO_MIME_TYPE);

                $file = new UploadedFile($file, basename($file), finfo_file($finfo, $file), $this->files->size($file));
            } elseif (! $file instanceof UploadedFile) {
                continue;
            }

            $this->uploads[$key] = $file;
        }

        return $this;
    }
public function attach(array $files)
    {
        foreach ($files as $key => $file) {
            if (is_array($file)) {
                $file = new UploadedFile($file['path'], basename($file['path']), $file['mime'], $file['size']);
            } elseif (is_string($file)) {
                $finfo = finfo_open(FILEINFO_MIME_TYPE);

                $file = new UploadedFile($file, basename($file), finfo_file($finfo, $file), $this->files->size($file));
            } elseif (! $file instanceof UploadedFile) {
                continue;
            }

            $this->uploads[$key] = $file;
        }

        return $this;
    }
public function attach ( array $ files ) { foreach ( $ files as $ key => $ file ) { if ( is_array ( $ file ) ) { $ file = new UploadedFile ( $ file [ 'path' ] , basename ( $ file [ 'path' ] ) , $ file [ 'mime' ] , $ file [ 'size' ] ) ; } elseif ( is_string ( $ file ) ) { $ finfo = finfo_open ( FILEINFO_MIME_TYPE ) ; $ file = new UploadedFile ( $ file , basename ( $ file ) , finfo_file ( $ finfo , $ file ) , $ this -> files -> size ( $ file ) ) ; } elseif ( ! $ file instanceof UploadedFile ) { continue ; } $ this -> uploads [ $ key ] = $ file ; } return $ this ; }
Attach files to be uploaded.

@param array $files

@return \Dingo\Api\Dispatcher
Attach files to be uploaded .