循环通过图像阵列并移动它们-拉拉威尔


Looping through image array and moving them - Laravel

我有一个表单,它有5个文件输入来创建一个图像数组。

在处理时,我希望循环浏览图像并对其进行处理。

$images = Input::get('images');
// image proccessing
foreach ($images as $image) {
  print_r($image);
}

这将输出文件名,但如果我在$image变量上调用move函数,我会得到"在字符串上调用的方法move"。

我该怎么做?

You should be doing something like this 
       $input = Input::file('files'); //get file as input
        //check if input has file 
        if ($input){
            foreach($input as $key){
            //loop through file and perform action...
              $array = Image::file_upload($key, 'file', 'Images');
              // I assume you have your method for upload like the above
              $key = $array['filename'];
              print_r($key);    
            }
        }
        $this->image->save($input); //save to db file name.