ошибка
Код: Выделить всё
The "C:\xampp\tmp\phpF80B.tmp" file does not exist or is not readable.
Код: Выделить всё
public function store(ArticleRequest $request)
{
$imagesUrl = $this->uploadImages($request->file('images'));
auth()->user()->article()->create(array_merge($request->all() , [ 'images' => $imagesUrl]));
return redirect(route('articles.index'));
}
Код: Выделить всё
protected function uploadImages($file)
{
$year = Carbon::now()->year;
$imagePath = "/upload/images/{$year}/";
$filename = $file->getClientOriginalName();
$file = $file->move(public_path($imagePath) , $filename);
$sizes = ["300" , "600" , "900"];
$url['images'] = $this->resize($file->getRealPath() , $sizes , $imagePath , $filename);
$url['thumb'] = $url['images'][$sizes[0]];
return $url;
}
Код: Выделить всё
private function resize($path , $sizes , $imagePath , $filename)
{
$images['original'] = $imagePath . $filename;
foreach ($sizes as $size) {
$images[$size] = $imagePath . "{$size}_" . $filename;
Image::make($path)->resize($size, null, function ($constraint) {
$constraint->aspectRatio();
})->save(public_path($images[$size]));
}
return $images;
}
Кнопка "C: Файл \xampp\tmp\phpF80B.tmp" не существует или не читается.
как устранить эту ошибку?
Подробнее здесь: https://stackoverflow.com/questions/583 ... this-error
Мобильная версия