Level 6
are the fields you want to update (name and avatar) in the $fillable-array in your User-Model?
Alternatively is $guarded set to an empty array?
i dont know where i did a mistake but right now my Avatar Profile can't be updated im forget to track the changes but here the controller
public function update(Request $request, $username)
{
$this->validate(request(), [
'name' =>'required|max:30',
'username' =>'required|max:30|alpha_dash|unique:users',
]);
$user = $this->getUserByUsername($username);
$input = Input::only('name', 'username');
if ($request->hasFile('avatar')) {
$request->file('avatar')->store('public/users/');
$user->avatar = $request->file('avatar')->hashName('users/');
}
$user->fill($input)->save();
$user->save();
return redirect('profile/'.$user->username.'/account')->with('success', 'Profil Telah di Update');
}
the username still work, but the name and avatar didnt update it, whats wroong?
Please or to participate in this conversation.