📜  删除身份验证用户令牌 - 无论代码示例

📅  最后修改于: 2022-03-11 14:57:35.442000             🧑  作者: Mango

代码示例1
public function logout() {
    Auth::user()->tokens->each(function($token, $key) {
        $token->delete();
    });

    return response()->json('Successfully logged out');
}