public function file($key)
    {
        if (!isset($_FILES[$key])) {
            return null;
        }

        if (!is_array($_FILES[$key]['name'])) {
            return new UploadFile($_FILES[$key]);
        }

        $files = $_FILES[$key];

        $collect = [];

        foreach ($files['name'] as $key => $name) {
            $file['name'] = $name;

            $file['type'] = $files['type'][$key];

            $file['size'] = $files['size'][$key];

            $file['error'] = $files['error'][$key];

            $file['tmp_name'] = $files['tmp_name'][$key];

            $collect[] = new UploadFile($file);
        }

        return new Collection($collect);
    }
public function file($key)
    {
        if (!isset($_FILES[$key])) {
            return null;
        }

        if (!is_array($_FILES[$key]['name'])) {
            return new UploadFile($_FILES[$key]);
        }

        $files = $_FILES[$key];

        $collect = [];

        foreach ($files['name'] as $key => $name) {
            $file['name'] = $name;

            $file['type'] = $files['type'][$key];

            $file['size'] = $files['size'][$key];

            $file['error'] = $files['error'][$key];

            $file['tmp_name'] = $files['tmp_name'][$key];

            $collect[] = new UploadFile($file);
        }

        return new Collection($collect);
    }
public function file ( $ key ) { if ( ! isset ( $ _FILES [ $ key ] ) ) { return null ; } if ( ! is_array ( $ _FILES [ $ key ] [ 'name' ] ) ) { return new UploadFile ( $ _FILES [ $ key ] ) ; } $ files = $ _FILES [ $ key ] ; $ collect = [ ] ; foreach ( $ files [ 'name' ] as $ key => $ name ) { $ file [ 'name' ] = $ name ; $ file [ 'type' ] = $ files [ 'type' ] [ $ key ] ; $ file [ 'size' ] = $ files [ 'size' ] [ $ key ] ; $ file [ 'error' ] = $ files [ 'error' ] [ $ key ] ; $ file [ 'tmp_name' ] = $ files [ 'tmp_name' ] [ $ key ] ; $ collect [ ] = new UploadFile ( $ file ) ; } return new Collection ( $ collect ) ; }
Load the factory for FILES

@param string $key
@return UploadFile|Collection
Load the factory for FILES