'datetime', ]; /** * Perform any actions required after the model boots. * * @return void */ protected static function booted() { static::creating(function (self $user) { $user->password = Hash::make($user->password); }); static::updating(function (self $user) { if (Hash::needsRehash($user->password)) { $user->password = Hash::make($user->password); } }); } }