1
등록 중에 프로필 이미지로 이미지를 업로드해야하는 등록 양식이 있습니다. 사용자가 나중에 업로드 할 수 있으므로 등록 양식에서이 업로드 필드를 제거하고 싶습니다. 그러나 문제는 등록입니다. 필드가 비어있을 수 없습니다 있도록 양식 이미지 프로세스에 연결되어,이 상점에 대한 코드가 등록 컨트롤러 내부의 제안입니다 :laravel의 등록 양식에서 이미지 입력란을 제거하십시오.
이 어떻게 디폴트 값을 제공 또는 이미지 처리에서 분리 할 수
public function store(RegisterUserRequest $request)
{
$newUserProfileImagePath = $profileImagePath = App::make('ProcessImage')->execute($request->file('profileimage'), 'images/profileimages/', 180, 180);
$newUserBirthday = Carbon::createFromDate($request->year, $request->month, $request->day);
$newUser = $this->dispatchFrom(RegisterUserCommand::class, $request, [
'birthday' => $newUserBirthday,
'profileImagePath' => $newUserProfileImagePath
]);
return redirect()->route('feeds_path');
}
?
결코 호출되지 않는 방식으로 이미지 처리와 연결된 코드 줄을 제거하십시오. –
해당 이미지를 제거하면이 오류가 발생합니다. MarshalException MarshalException.php 17 행 : [프로필 이미지] 매개 변수를 다음으로 매핑 할 수 없습니다. 명령 [App \ Commands \ RegisterUserCommand] – Mehran
또한 'profileImagePath'=> $ newUserProfileImagePath'을 제거 했습니까 –