调用laravel中未定义的函数move()


Call to undefined function move() in laravel

嗨,我从手机上得到一个图像,并尝试将其移动到almacernarlo的文件夹。当我试图移动它时,我得到一个错误的问题。

Symfony ' Component ' Debug ' Exception ' FatalErrorException
Call to undefined function move()
我代码:

    public function subirImagenes($idServicio){
    //$file_path = "uploads/";
    //dd(public_path());
    $path = public_path().'/servicios/1';//.$idServicio;
    /*$file_path = $file_path . basename( $_FILES['uploaded_file']['name']);
    if(move_uploaded_file($_FILES['uploaded_file']['tmp_name'], $file_path)) {
        echo "success";
    } else{
        echo "fail";
    }*/
    if($_FILES){
        //$file = $_FILES['file'];
        //move_uploaded_file($file, $file_path);
        //$fileContents = file_get_contents($file["tmp_name"]);
        //print_r($fileContents);
        $file = Input::file('file');
        if($file>move($path, '1')){
            $array = array('Message' => 'Imagen Movida', 'Code' => '202');
        }else{
            $array = array('Error' => 'InvalidArgumentError' , 'Code' => '404', 'Message' => 'Error interno');
        }
        return Response::json($array);
    }
}

我该如何修复它?

我想你打错字了:

$file>move($path, '1')
应:

$file->move($path, '1')

您想调用$file->move()而不是将$filemove()进行比较