Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/image/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Laravel ';图像源不可读';每次使用干预包时都会发生错误_Laravel_Image_Path_Intervention_Image File - Fatal编程技术网

Laravel ';图像源不可读';每次使用干预包时都会发生错误

Laravel ';图像源不可读';每次使用干预包时都会发生错误,laravel,image,path,intervention,image-file,Laravel,Image,Path,Intervention,Image File,这是我的代码,$image变量没有得到任何东西,它返回了错误“image source not readable”,请帮助我。提前感谢:) 尝试使用存储外观获取存储的图像 $image=image::make(存储::磁盘('public')->get($imagePath))->fit(10001000); $imagePath = (request('image')->store('uploads', 'public')); //dd($imagePath);

这是我的代码,$image变量没有得到任何东西,它返回了错误“image source not readable”,请帮助我。提前感谢:)

尝试使用
存储
外观获取存储的图像

$image=image::make(存储::磁盘('public')->get($imagePath))->fit(10001000);
    $imagePath = (request('image')->store('uploads', 'public'));
     //dd($imagePath);
    $image= Image::make(public_path("storage/{$imagePath}"))->fit(1000,1000);
    $image->save();

    auth()->user()->posts()->create([
        'caption'=>$data['caption'],
        'image'=>$imagePath,
    ]);