ask('输入用户 id'); $user = User::find($userIde); if (!$user) { return $this->error('用户不存在'); } // 一年后过期 $ttl = 365 * 24 * 60; $this->info(Auth::guard('api')->setTTl($ttl)->fromUser($user)); } }