base64Image我正在尝试使用 laravel存储但它返回此错误:
Can't write image data to path (/home/u187504358/domains/example.com/public/images/Group-1590235658.jpg)
代码
if ($request->photo) {
$photo = $request->photo;
$filename = 'Group' . '-' . time() . '.' . 'jpg';
$location = public_path('images/'. $filename);
Image::make(file_get_contents($photo))->resize(500, 500)->save($location);
$oldFilename = $group->photo;
if(!empty($group->photo)){
Storage::delete($oldFilename);
}
$group->photo = $filename;
}
filesystem.php
'default' => env('FILESYSTEM_DRIVER', 'local'),
'disks' => [
'local' => [
'driver' => 'local',
'root' => public_path('images/'),
],
]
任何想法?
幕布斯6054654