dostogir
1 week ago
108
4
Laravel

SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'name' cannot be null

Posted 1 week ago by dostogir

This Is My Controller Code

public function update_avatar(Request $request){ // Logic for user upload of avatar if($request->hasFile('avatar')){ $avatar = $request->file('avatar'); $filename = time() . '.' . $avatar->getClientOriginalExtension(); Image::make($avatar)->resize(300, 300)->save( public_path('/uploads/avatars/' . $filename ) ); $user = Auth::user(); $user->avatar = $filename; $user->save(); } return view('user_profile_lite', ['user' => Auth::user()] ); }

Please sign in or create an account to participate in this conversation.