如何重写Laravel中的logoutOtherDevices函数

问题描述

我在重写Laravel中的功能时遇到了一些问题。这是laravel中供应商文件夹(Illuminate \ Auth \ SessionGuard)中的logoutOtherDevices函数。我想在此函数中传递$user_name,以允许某些用户可以多次登录

public function logoutOtherDevices($password,$user_name,$attribute = 'password')
        {
            if (! $this->user() || $this->user()->user_name == $user_name) {
                return;
            }
    
            $result = tap($this->user()->forceFill([
                $attribute => Hash::make($password),]))->save();
    
            $this->queueRecallerCookie($this->user());
    
            return $result;
        }

但是由于这是在vendor文件夹中,所以我不愿意在核心文件中编辑代码
有人可以给我一些指导,以在LoginController中重写此功能吗?
因为我计划添加一些条件来结束其他设备上的用户会话。
感谢所有的建议和指导。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)