src/Concerns/InteractsWithPages.php
protected function prepareArrayBasedFileInput(&$uploads, $key, $file)
    {
        preg_match_all('/([^\[\]]+)/', $key, $segments);

        $segments = array_reverse($segments[1]);

        $newKey = array_pop($segments);

        foreach ($segments as $segment) {
            $file = [$segment => $file];
        }

        $uploads[$newKey] = $file;

        unset($uploads[$key]);
    }
protected function prepareArrayBasedFileInput(&$uploads, $key, $file)
    {
        preg_match_all('/([^\[\]]+)/', $key, $segments);

        $segments = array_reverse($segments[1]);

        $newKey = array_pop($segments);

        foreach ($segments as $segment) {
            $file = [$segment => $file];
        }

        $uploads[$newKey] = $file;

        unset($uploads[$key]);
    }
protected function prepareArrayBasedFileInput ( & $ uploads , $ key , $ file ) { preg_match_all ( '/([^\[\]]+)/' , $ key , $ segments ) ; $ segments = array_reverse ( $ segments [ 1 ] ) ; $ newKey = array_pop ( $ segments ) ; foreach ( $ segments as $ segment ) { $ file = [ $ segment => $ file ] ; } $ uploads [ $ newKey ] = $ file ; unset ( $ uploads [ $ key ] ) ; }
Store an array based file upload with the proper nested array structure.

@param  array  $uploads
@param  string  $key
@param  mixed  $file
Store an array based file upload with the proper nested array structure .