Author
Topic: random topic (Read 1325 Times)
Member
United States
Posts: 3

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
Follow us on our social networks:
Lampforo

Webmasters Forum for buying and selling services, a site for online business and networking.

About

Contact

Caracas/Venezuela

contact@lampforo.com

+ 58 0424-166-6224

© 2025 Copyright: Developed by AgenciaSEOCastro