Topic: random topic (Read 1325 Times)
Call to undefined cast [hashed] on column [password] in model [App\Models\User] , If you are receiving this error when entering a password from a controller other than users, follow the next process to resolve the error.
$email = 'test@gmail.com';
$password = password_hash('demopass',PASSWORD_BCRYPT);
$u = new User;
$u->email = $email;
$u->email_verified_at = now();
$u->password = $password;
$u->remember_token = Str::random(10);
$u->save();
In the User.php model, remove the following line from the array:
protected $casts = [
'email_verified_at' => 'datetime'
];
01-06-2025