I need to generate a default password for users of my login table. The password must be the same for all users for first access to the system. The registration already exists, but I have to modify the passwords. The problem happens when I update passwords, only the first user of the table can log in.
public function recadastroSenha(){
$users = User::whereRaw("flag_del = 0 ")->get();
foreach($users as $user){
$senha = "senha123";
$user->password = bcrypt($senha);
}
$user->save();
}
Even if you update all table rows with different encryptions, only the first user performs login .