Is that all your code ? fill() just fill your object, it doesn't save it to the database. Do you call save() after that ?
Mar 3, 2021
5
Level 2
Updating table using fill() method doesn't works
Hi, I've the next code:
$user->fill(['password' => $hashPassword]);
in which $user is ans instance fot from a User::find($request->user) that returns the correct user model. I've too the filalble protected property in my model as follows:
protected $fillable = [
'niu',
'password',
];
Does anyone knows why the database is never updated with this password?
Thanks!
Please or to participate in this conversation.