private function getFilesToProcess(Request $request, $namespace, $files = null)
    {
        $this->app['upload.namespace'] = $namespace;

        if ($files === null) {
            $files = $request->files->get($namespace);
        }

        if (!$files) {
            return [];
        }
        $filesToProcess = [];
        foreach ($files as $file) {
            if ($file instanceof UploadedFile) {
                $filesToProcess[] = [
                    'name'     => $file->getClientOriginalName(),
                    'tmp_name' => $file->getPathname(),
                ];
            } else {
                $filesToProcess[] = $file;
            }
        }

        return $filesToProcess;
    }
private function getFilesToProcess(Request $request, $namespace, $files = null)
    {
        $this->app['upload.namespace'] = $namespace;

        if ($files === null) {
            $files = $request->files->get($namespace);
        }

        if (!$files) {
            return [];
        }
        $filesToProcess = [];
        foreach ($files as $file) {
            if ($file instanceof UploadedFile) {
                $filesToProcess[] = [
                    'name'     => $file->getClientOriginalName(),
                    'tmp_name' => $file->getPathname(),
                ];
            } else {
                $filesToProcess[] = $file;
            }
        }

        return $filesToProcess;
    }
private function getFilesToProcess ( Request $ request , $ namespace , $ files = null ) { $ this -> app [ 'upload.namespace' ] = $ namespace ; if ( $ files === null ) { $ files = $ request -> files -> get ( $ namespace ) ; } if ( ! $ files ) { return [ ] ; } $ filesToProcess = [ ] ; foreach ( $ files as $ file ) { if ( $ file instanceof UploadedFile ) { $ filesToProcess [ ] = [ 'name' => $ file -> getClientOriginalName ( ) , 'tmp_name' => $ file -> getPathname ( ) , ] ; } else { $ filesToProcess [ ] = $ file ; } } return $ filesToProcess ; }
Determine the list of files to upload.

@param Request $request
@param string  $namespace
@param string  $files

@return array
Determine the list of files to upload .