【发布时间】:2021-08-18 13:34:54
【问题描述】:
在 Illuminate/Auth/SessionGuard.php 中有一个方法fireOtherDeviceLogoutEvent($user)。
我想从我的 UserController 中调用它。
最好的方法是什么?
【问题讨论】:
在 Illuminate/Auth/SessionGuard.php 中有一个方法fireOtherDeviceLogoutEvent($user)。
我想从我的 UserController 中调用它。
最好的方法是什么?
【问题讨论】:
我认为你可以编写一个新函数并在控制器中调用它。
希望对你有帮助。
use Illuminate\Auth\Events\OtherDeviceLogout;
protected function fireOtherDeviceLogoutEvent()
{
$name = Auth::getName();
$user = Auth::user();
event(new OtherDeviceLogout($name, $user));
}
【讨论】: