How to get current auto incremented value in this case?

后端 未结 1 505
别那么骄傲
别那么骄傲 2021-01-29 02:45

As you\'ll see in the picture, data with time \'left\' gets inserted in every field \'left\' under the name of current user. This is because in function logout() I find the user

1条回答
  •  被撕碎了的回忆
    2021-01-29 03:44

    Find the UserInfo by the user_id

    $info = \App\UserInfo::where('user_id', $id)->firstOrFail();
    

    Please note that your table will become huge if a lot of users login and logout, old data don't seem relevant if you want to implement the last seen feature of a messaging chat app

    0 讨论(0)
提交回复
热议问题