Image Intervention w/ Laravel 5.4 Storage

后端 未结 10 844
执笔经年
执笔经年 2021-02-05 03:16

I\'m using the storage facade to store a avatar which works fine, but I want to resize my image like I did in previous versions of laravel. How can I go about doing this? Here i

10条回答
  •  盖世英雄少女心
    2021-02-05 03:38

    Try updating the GD extension for the current php version.

    If that doesn't help, try saving the resized image on local disk and using Storage::putFile.

    You may delete the file once it has been uploaded to your storage path.

    The second parameter to your putFile method is an instance of the Image Intervention class. You need to pass this as the second parameter to the putFile method.

    $resize->save($absolutePath . 'small/' . $imageName);
    

提交回复
热议问题