почему не видит $ request->hasFile(‘newphoto’) в ресурсном контроллере?
if ($ request->hasFile('newphoto')) { $ destinationPath = 'news'; $ ph = $ request->file('newphoto'); $ fileName = $ ph->getClientOriginalName(); if(!Storage::disk('public')->exists($ destinationPath)) { Storage::disk('public')->makeDirectory($ destinationPath, 0775, true); //creates directory } Storage::disk('public')->put($ destinationPath.'/'.$ fileName, file_get_contents($ ph)); $ request->image = $ destinationPath.'/'. $ fileName; } else $ request->image = '';
хотя если выводить так $ request->newphoto показывает что в инпут было добавлено фото
The post ресурсный контроллер appeared first on 100% Private Proxies - Fast, Anonymous, Quality, Unlimited USA Private Proxy!.