疑問:laravel框架 User一般會設(shè)置隱藏 password 和 remember_token
```
/**
? ? * 檢查原密碼是否正確
? ? *
? ? * @param User $user
? ? * @param $old_password
? ? * @return mixed
? ? */
? ? protected function confirmedOldPassword(User $user, $old_password)
? ? {
? ? ? ? \Log::info(__FUNCTION__ . ',old:' . $old_password . ',user:' . json_encode($user));
? ? ? ? \Log::info('user password'.$user->password);
? ? ? ? return Hash::check($old_password, $user->password);
? ? }
```
日志:
```
[2019-01-09 14:08:15] local.INFO: confirmedOldPassword,old:123456,user:{"id":2,"name":"Felix2","email":"378823123@qq.com","created_at":"2019-01-04 22:02:33","updated_at":"2019-01-09 14:02:55","username":"JJG","sex":0,"login_at":null,"login_ip":null,"avatar":"images\/avatar\/201901\/09\/MIftuayOGuaigFLBzGa8dkr6HhenGW3fX2smxXuB.jpeg","bool_admin":0,"status":1}?
[2019-01-09 14:08:15] local.INFO: user password:$2y$10$vgiAmcLDMCY.9c21KsnVeeEE2G/tXHI/RaHgg2EFWzUCl6.4kRdX2
```
現(xiàn)象:$user 里沒有 password? 但是 $user->password 能夠取到值。