我无法覆盖以下代码中的 $user->id :
$followers_list = follow::where('followed_id',$userId['userId'])
->get();
foreach($followers_list as $follower)
{
$user = myuser::find($follower->follower_id);
echo $user->id;//everything is fine
$user->id = Crypt::encrypt(['id'=> $user->id]);
echo $user->id; //it's zero for all users
array_push($followers,$user);
}
防止这种类型转换(整数到字符串)是laravel eloquent中的规则还是某些东西?
如何用加密字符串替换 id 的整数值?
有什么帮助吗?