diff --git a/src/Auth/Auth.php b/src/Auth/Auth.php index ecef27d..3fe104a 100644 --- a/src/Auth/Auth.php +++ b/src/Auth/Auth.php @@ -116,6 +116,7 @@ public function attempt($credentials) $jwt->browser = \Request::get('browser'); $jwt->os = \Request::get('os'); $jwt->device = \Request::get('device'); + $jwt->ip = \Request::get('ip'); $jwt->active = true; $jwt->guard = $this->guard; $jwt->save(); @@ -183,6 +184,14 @@ public function id() } + public function auths() + { + $auths = KauthModel::where('user_id',$this->id()) + ->orderBy('id','desc') + ->get(); + return $auths; + } + /** * * auth logout