From 4dfbb0cb4bf77aa1e6034d8ff9e6e662cb4dbbb1 Mon Sep 17 00:00:00 2001 From: mostafa Date: Sun, 31 Mar 2019 15:42:16 +0600 Subject: [PATCH] fix ip request --- src/Auth/Auth.php | 9 +++++++++ 1 file changed, 9 insertions(+) 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